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/ex_getln.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/ex_getln.c')
-rw-r--r-- | src/ex_getln.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c index ad0f07e3f..a49fa05eb 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -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); |