summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2022-04-09 18:17:34 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-09 18:17:34 +0100
commit2bf52dd065495cbf28e28792f2c2d50d44546d9f (patch)
treef6c2fabb35e2f7f12f441d76048b3f1575f4a6b4 /src/edit.c
parent81b46a6ccd818609e1ca8cd410e26a58428c30ba (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/edit.c')
-rw-r--r--src/edit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index 1585f85184..fad2a7b1a4 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -284,7 +284,7 @@ edit(
else
State = INSERT;
- trigger_modechanged();
+ may_trigger_modechanged();
stop_insert_mode = FALSE;
#ifdef FEAT_CONCEAL
@@ -3701,7 +3701,7 @@ ins_esc(
#endif
State = NORMAL;
- trigger_modechanged();
+ may_trigger_modechanged();
// need to position cursor again when on a TAB
if (gchar_cursor() == TAB)
curwin->w_valid &= ~(VALID_WROW|VALID_WCOL|VALID_VIRTCOL);
@@ -3838,7 +3838,7 @@ ins_insert(int replaceState)
State = INSERT | (State & LANGMAP);
else
State = replaceState | (State & LANGMAP);
- trigger_modechanged();
+ may_trigger_modechanged();
AppendCharToRedobuff(K_INS);
showmode();
#ifdef CURSOR_SHAPE