mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -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
@@ -1696,6 +1696,10 @@ getcmdline_int(
|
||||
// Trigger CmdlineEnter autocommands.
|
||||
cmdline_type = firstc == NUL ? '-' : firstc;
|
||||
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINEENTER);
|
||||
#ifdef FEAT_EVAL
|
||||
if (!debug_mode)
|
||||
trigger_modechanged();
|
||||
#endif
|
||||
|
||||
init_history();
|
||||
hiscnt = get_hislen(); // set hiscnt to impossible history value
|
||||
@@ -2461,6 +2465,12 @@ returncmd:
|
||||
trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVE);
|
||||
|
||||
State = save_State;
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (!debug_mode)
|
||||
trigger_modechanged();
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INPUT_METHOD
|
||||
if (b_im_ptr != NULL && *b_im_ptr != B_IMODE_LMAP)
|
||||
im_save_status(b_im_ptr);
|
||||
|
Reference in New Issue
Block a user