I'm using Scintilla 4.1, on Windows. I discovered that SCI_SETSELECTION doesn't send SC_UPDATE_SELECTION event. I see that Editor.cxx, line 8021:
case SCI_CLEARSELECTIONS:
sel.Clear();
ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
case SCI_SETSELECTION:
sel.SetSelection(SelectionRange(static_cast<Sci::Position>(wParam), lParam));
Redraw();
break;
case SCI_ADDSELECTION:
sel.AddSelection(SelectionRange(static_cast<Sci::Position>(wParam), lParam));
ContainerNeedsUpdate(SC_UPDATE_SELECTION);
Redraw();
break;
Should SCI_SETSELECTION also call ContainerNeedsUpdate(SC_UPDATE_SELECTION) as others?
Duplicate of [#1723].
Related
Bugs:
#1723In duplicate;
But right now, SCI_ADDSELECTION raises SC_UPDATE_SELECTION, but SCI_SET_SELECTION do not. I can understand it if it's not a bug. But all those API's behave not same for firing or not, and in the documentation i can not find any thing about, which fires an update event, and which not. Should APIs not listed under SC_UPDATE_SELECTION-Documentation, that fires this event?
I do not think it is worth the effort to change and maintain the documentation.
Then it will be enough to update documentation to list APIs that fires SC_UPDATE_X-Events. As i can see, is SCI_ADDSELECTION the only API that doesn't sends SC_UPDATE_SELECTION or is there any others? I'm calling now SCI_SETMAINSELECTION(0) after SCI_SETSELECTION to have Update-Events. Is this call the lowest cost way to have an update event or is there any other elegant way to do it? Thank you.