diff src/memline.c @ 17364:31f31e938961 v8.1.1681

patch 8.1.1681: insert stray "{" when listener gets buffer line commit https://github.com/vim/vim/commit/0fb286e82d28730fcb3293894dd4df2e069eaf9a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 13 20:14:45 2019 +0200 patch 8.1.1681: insert stray "{" when listener gets buffer line Problem: Insert stray "{" when listener gets buffer line. (Paul Jolly) Solution: Flush the cached line after invoking listeners. (closes https://github.com/vim/vim/issues/4455)
author Bram Moolenaar <Bram@vim.org>
date Sat, 13 Jul 2019 20:15:04 +0200
parents d03a52e02f1a
children 9b6c0ef29c20
line wrap: on
line diff
--- 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