aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-11-30 22:13:50 -0500
committerGitHub <noreply@github.com>2021-11-30 22:13:50 -0500
commit828bf128a64466f254629b102e283af35666cd05 (patch)
tree6cda5c2df8d799d87d86dcfabc595e2737b8feda /src/nvim/ex_getln.c
parent2635b77dba6fa218871441fa3380860405bf9240 (diff)
parent980c68d0362c3ca099c0facef2d08efede76aabf (diff)
downloadrneovim-828bf128a64466f254629b102e283af35666cd05.tar.gz
rneovim-828bf128a64466f254629b102e283af35666cd05.tar.bz2
rneovim-828bf128a64466f254629b102e283af35666cd05.zip
Merge pull request #15840 from vimpostor/vim-8.2.3430
vim-patch:8.2.{3430,3434,3462,3463,3555,3609,3610}: ModeChanged autocmd
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index 3b5953ae69..9cf39802de 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -880,7 +880,8 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
TryState tstate;
Error err = ERROR_INIT;
bool tl_ret = true;
- dict_T *dict = get_vim_var_dict(VV_EVENT);
+ save_v_event_T save_v_event;
+ dict_T *dict = get_v_event(&save_v_event);
char firstcbuf[2];
firstcbuf[0] = (char)(firstc > 0 ? firstc : '-');
firstcbuf[1] = 0;
@@ -894,7 +895,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
apply_autocmds(EVENT_CMDLINEENTER, (char_u *)firstcbuf, (char_u *)firstcbuf,
false, curbuf);
- tv_dict_clear(dict);
+ restore_v_event(dict, &save_v_event);
tl_ret = try_leave(&tstate, &err);
@@ -906,6 +907,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
}
tl_ret = true;
}
+ trigger_modechanged();
state_enter(&s->state);
@@ -924,7 +926,7 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
if (tv_dict_get_number(dict, "abort") != 0) {
s->gotesc = 1;
}
- tv_dict_clear(dict);
+ restore_v_event(dict, &save_v_event);
}
cmdmsg_rl = false;
@@ -2289,7 +2291,8 @@ static int command_line_changed(CommandLineState *s)
if (has_event(EVENT_CMDLINECHANGED)) {
TryState tstate;
Error err = ERROR_INIT;
- dict_T *dict = get_vim_var_dict(VV_EVENT);
+ save_v_event_T save_v_event;
+ dict_T *dict = get_v_event(&save_v_event);
char firstcbuf[2];
firstcbuf[0] = (char)(s->firstc > 0 ? s->firstc : '-');
@@ -2303,7 +2306,7 @@ static int command_line_changed(CommandLineState *s)
apply_autocmds(EVENT_CMDLINECHANGED, (char_u *)firstcbuf,
(char_u *)firstcbuf, false, curbuf);
- tv_dict_clear(dict);
+ restore_v_event(dict, &save_v_event);
bool tl_ret = try_leave(&tstate, &err);
if (!tl_ret && ERROR_SET(&err)) {
@@ -6547,6 +6550,7 @@ static int open_cmdwin(void)
cmdmsg_rl = save_cmdmsg_rl;
State = save_State;
+ trigger_modechanged();
setmouse();
return cmdwin_result;