diff src/edit.c @ 25967:46205b125fbd v8.2.3517

patch 8.2.3517: TextChanged does not trigger after TextChangedI Commit: https://github.com/vim/vim/commit/db3b44640d69ab27270691a3cab8d83cc93a0861 Author: Christian Brabandt <cb@256bit.org> Date: Sat Oct 16 11:58:55 2021 +0100 patch 8.2.3517: TextChanged does not trigger after TextChangedI Problem: TextChanged does not trigger after TextChangedI. Solution: Store the tick separately for TextChangedI. (Christian Brabandt, closes #8968, closes #8932)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Oct 2021 13:00:04 +0200
parents 45a8b2b2f652
children 2fc13817b100
line wrap: on
line diff
--- a/src/edit.c
+++ b/src/edit.c
@@ -1477,9 +1477,9 @@ ins_redraw(int ready)	    // not busy wi
 	last_cursormoved = curwin->w_cursor;
     }
 
-    // Trigger TextChangedI if b_changedtick differs.
+    // Trigger TextChangedI if b_changedtick_i differs.
     if (ready && has_textchangedI()
-	    && curbuf->b_last_changedtick != CHANGEDTICK(curbuf)
+	    && curbuf->b_last_changedtick_i != CHANGEDTICK(curbuf)
 	    && !pum_visible())
     {
 	aco_save_T	aco;
@@ -1489,15 +1489,15 @@ ins_redraw(int ready)	    // not busy wi
 	aucmd_prepbuf(&aco, curbuf);
 	apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
 	aucmd_restbuf(&aco);
-	curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
+	curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf);
 	if (tick != CHANGEDTICK(curbuf))  // see ins_apply_autocmds()
 	    u_save(curwin->w_cursor.lnum,
 					(linenr_T)(curwin->w_cursor.lnum + 1));
     }
 
-    // Trigger TextChangedP if b_changedtick differs. When the popupmenu closes
-    // TextChangedI will need to trigger for backwards compatibility, thus use
-    // different b_last_changedtick* variables.
+    // Trigger TextChangedP if b_changedtick_pum differs. When the popupmenu
+    // closes TextChangedI will need to trigger for backwards compatibility,
+    // thus use different b_last_changedtick* variables.
     if (ready && has_textchangedP()
 	    && curbuf->b_last_changedtick_pum != CHANGEDTICK(curbuf)
 	    && pum_visible())