summaryrefslogtreecommitdiffstats
path: root/src/memline.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memline.c')
-rw-r--r--src/memline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/memline.c b/src/memline.c
index 0e3bdb8b6b..b9de06e1df 100644
--- a/src/memline.c
+++ b/src/memline.c
@@ -2836,8 +2836,10 @@ ml_append_int(
#ifdef FEAT_EVAL
// When inserting above recorded changes: flush the changes before changing
- // the text.
+ // the text. Then flush the cached line, it may become invalid.
may_invoke_listeners(buf, lnum + 1, lnum + 1, 1);
+ if (curbuf->b_ml.ml_line_lnum != 0)
+ ml_flush_line(curbuf);
#endif
#ifdef FEAT_TEXT_PROP