mirror of
https://github.com/vim/vim.git
synced 2025-09-27 04:14:06 -04:00
patch 8.2.3430: no generic way to trigger an autocommand on mode change
Problem: No generic way to trigger an autocommand on mode change. Solution: Add the ModeChanged autocommand event. (Magnus Gross, closes #8856)
This commit is contained in:
committed by
Bram Moolenaar
parent
464393a696
commit
f1e8876fa2
@@ -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
|
||||
|
Reference in New Issue
Block a user