0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -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:
=?UTF-8?q?Magnus=20Gro=C3=9F?=
2021-09-12 13:39:55 +02:00
committed by Bram Moolenaar
parent 464393a696
commit f1e8876fa2
13 changed files with 135 additions and 4 deletions

View File

@@ -1256,6 +1256,9 @@ EXTERN int listcmd_busy INIT(= FALSE); // set when :argdo, :windo or
// :bufdo is executing
EXTERN int need_start_insertmode INIT(= FALSE);
// start insert mode soon
#if defined(FEAT_EVAL) || defined(PROTO)
EXTERN char_u last_mode[MODE_MAX_LENGTH] INIT(= "n"); // for ModeChanged event
#endif
EXTERN char_u *last_cmdline INIT(= NULL); // last command line (for ":)
EXTERN char_u *repeat_cmdline INIT(= NULL); // command line for "."
EXTERN char_u *new_last_cmdline INIT(= NULL); // new value for last_cmdline