diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-04-09 18:17:34 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-09 18:17:34 +0100 |
commit | 2bf52dd065495cbf28e28792f2c2d50d44546d9f (patch) | |
tree | f6c2fabb35e2f7f12f441d76048b3f1575f4a6b4 /src/insexpand.c | |
parent | 81b46a6ccd818609e1ca8cd410e26a58428c30ba (diff) |
patch 8.2.4723: the ModeChanged autocmd event is inefficientv8.2.4723
Problem: The ModeChanged autocmd event is inefficient.
Solution: Avoid allocating memory. (closes #10134) Rename
trigger_modechanged() to may_trigger_modechanged().
Diffstat (limited to 'src/insexpand.c')
-rw-r--r-- | src/insexpand.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/insexpand.c b/src/insexpand.c index b7b6c0256c..2c549f828c 100644 --- 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 *list) // 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; } |