diff src/insexpand.c @ 28397:d1702731786c v8.2.4723

patch 8.2.4723: the ModeChanged autocmd event is inefficient Commit: https://github.com/vim/vim/commit/2bf52dd065495cbf28e28792f2c2d50d44546d9f Author: LemonBoy <thatlemon@gmail.com> Date: Sat Apr 9 18:17:34 2022 +0100 patch 8.2.4723: the ModeChanged autocmd event is inefficient Problem: The ModeChanged autocmd event is inefficient. Solution: Avoid allocating memory. (closes https://github.com/vim/vim/issues/10134) Rename trigger_modechanged() to may_trigger_modechanged().
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Apr 2022 19:30:02 +0200
parents a9eeb18e749c
children d770568e6c98
line wrap: on
line diff
--- a/src/insexpand.c
+++ b/src/insexpand.c
@@ -257,7 +257,7 @@ ins_ctrl_x(void)
 	// CTRL-V look like CTRL-N
 	ctrl_x_mode = CTRL_X_CMDLINE_CTRL_X;
 
-    trigger_modechanged();
+    may_trigger_modechanged();
 }
 
 /*
@@ -2381,7 +2381,7 @@ ins_compl_prep(int c)
 	// upon the (possibly failed) completion.
 	ins_apply_autocmds(EVENT_COMPLETEDONE);
 
-    trigger_modechanged();
+    may_trigger_modechanged();
 
     // reset continue_* if we left expansion-mode, if we stay they'll be
     // (re)set properly in ins_complete()
@@ -2865,7 +2865,7 @@ set_completion(colnr_T startcol, list_T 
     // Lazily show the popup menu, unless we got interrupted.
     if (!compl_interrupted)
 	show_pum(save_w_wrow, save_w_leftcol);
-    trigger_modechanged();
+    may_trigger_modechanged();
     out_flush();
 }
 
@@ -3818,7 +3818,7 @@ ins_compl_get_exp(pos_T *ini)
 	if (compl_curr_match == NULL)
 	    compl_curr_match = compl_old_match;
     }
-    trigger_modechanged();
+    may_trigger_modechanged();
 
     return i;
 }