diff options
author | =?UTF-8?q?Magnus=20Gro=C3=9F?= <magnus.gross@rwth-aachen.de> | 2021-09-12 13:39:55 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-09-12 13:39:55 +0200 |
commit | f1e8876fa2359b572d262772747405d3616db670 (patch) | |
tree | 1b33a32bccaa4522f14f2aad8ee8044295635d0b /src/edit.c | |
parent | 464393a6961d9b9de2bfe9c05f8e2ae5bdec0293 (diff) | |
download | vim-git-f1e8876fa2359b572d262772747405d3616db670.tar.gz |
patch 8.2.3430: no generic way to trigger an autocommand on mode changev8.2.3430
Problem: No generic way to trigger an autocommand on mode change.
Solution: Add the ModeChanged autocommand event. (Magnus Gross, closes #8856)
Diffstat (limited to 'src/edit.c')
-rw-r--r-- | src/edit.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/edit.c b/src/edit.c index 93b1342db..e1e796f0b 100644 --- a/src/edit.c +++ b/src/edit.c @@ -284,6 +284,7 @@ edit( else State = INSERT; + trigger_modechanged(); stop_insert_mode = FALSE; #ifdef FEAT_CONCEAL @@ -3681,6 +3682,7 @@ ins_esc( #endif State = NORMAL; + trigger_modechanged(); // need to position cursor again (e.g. when on a TAB ) changed_cline_bef_curs(); @@ -3811,6 +3813,7 @@ ins_insert(int replaceState) State = INSERT | (State & LANGMAP); else State = replaceState | (State & LANGMAP); + trigger_modechanged(); AppendCharToRedobuff(K_INS); showmode(); #ifdef CURSOR_SHAPE |