I've observed that the SCN_UPDATEUI notification doesn't fire when using the SCI_SETSELECTION, SCI_ADDSELECTION, and possibly other messages in the "multiple selection" family. For example, doing a "select all" from the end of the document to the start using SendMessage(handle, SCI_SETSELECTION, 50000, 0); no SCN_UPDATEUI notification is raised.
Is this a bug?
Thanks in advance.
SCN_UPDATEUI is required because the user may change the selection or scroll the document themselves with no call from the application. When this happens the application needs to know that the state has changed so SCN_UPDATEUI is sent.
However, when the application calls an API like SCI_SETSELECTION, it is in control and can perform any needed processing after the call. Its possible that sending SCN_UPDATEUI after SCI_SETSELECTION would simplify application code but its also possible that this could lead to existing applications receiving unexpected notifications and cause reentrance bugs.
For now, I'll say this is not a bug. However, it is something that could be reevaluated.
Fair enough. I can live with that answer. It's more or less exactly what I told our ScintillaNET users.
When/if you're interested in taking up the issue again I think the confusion comes from the fact that some of the other selection related commands such as SCI_SELECTALL and SCI_SETSEL DO send the SCN_UPDATEUI notification--leading to some (perceived) inconsistencies. It's a perfectly fine course of action in my mind to stop sending the SCN_UPDATEUI notification for all API calls if that's what you wanted to do.
Thanks Neil.