Need an API to update scrollbars.
case SCI_UPDATESCROLLBARS:
SetScrollBars();
break;
Because now vertical scrollbar becomes incorrect after adding, changing or removing annotations. Updating scrollbars for each added/removed/changed annotation would be slow, but I would update asynchronically, eg using a 10 ms timer.
Not changing the scrollbars when annotations are added or removed is a bug. It hasn't been visible is SciTE as other operations performed at the same time (such as defining the annotation styles) caused scrollbars to be updated.
Could be fixed with
Asynchronous scroll bar changes may improve performance in this and other situations but it is possible that this would cause bugs with stale scrollbars.
I applied the fix. Now SCI_ANNOTATIONSETTEXT works well. Itself it is many times slower now (when annotations are visible), but the async workaround was even slower. No problem. For max speed I can temporarily hide annotations (SCI_ANNOTATIONSETVISIBLE) when there are many annotations to add/remove/modify.
It seems that SCI_ANNOTATIONSETVISIBLE also has this problem. I added SetScrollBars(); in SetAnnotationVisible and now it works well.
Last edit: Gintaras Q 2017-05-10
Committed a fix as [61adfb].
Related
Commit: [61adfb]