patch 8.1.1332: cannot flush listeners without redrawing, mix of changes
Problem: Cannot flush change listeners without also redrawing. The line
numbers in the list of changes may become invalid.
Solution: Add listener_flush(). Invoke listeners before adding a change
that makes line numbers invalid.
diff --git a/src/screen.c b/src/screen.c
index 5cdbd2c..cbb0fa4 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -565,8 +565,13 @@
}
#ifdef FEAT_EVAL
- // Before updating the screen, notify any listeners of changed text.
- invoke_listeners();
+ {
+ buf_T *buf;
+
+ // Before updating the screen, notify any listeners of changed text.
+ FOR_ALL_BUFFERS(buf)
+ invoke_listeners(buf);
+ }
#endif
if (must_redraw)