aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-07-27 06:19:59 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-07-27 06:23:47 +0800
commit0c0a2e4e526109c6fcd44618e199b36927dff0ff (patch)
treebd4ba2cebad935e847f523701e0ce70f00626585 /src/nvim/ex_getln.c
parent9f1dc1466e0391c9f592455136f5a07106acf150 (diff)
downloadrneovim-0c0a2e4e526109c6fcd44618e199b36927dff0ff.tar.gz
rneovim-0c0a2e4e526109c6fcd44618e199b36927dff0ff.tar.bz2
rneovim-0c0a2e4e526109c6fcd44618e199b36927dff0ff.zip
vim-patch:9.0.0083: ModeChanged event not triggered when leaving cmdline window
Problem: ModeChanged event not triggered when leaving the cmdline window. Solution: Call may_trigger_modechanged(). (closes vim/vim#10791) https://github.com/vim/vim/commit/c9e8fd6fc7d2027d0645b376d95a6ed51098036c Code is already present in Nvim. Add some other related missing changes.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index a29063bf91..04334d4fa0 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -6805,9 +6805,13 @@ static int open_cmdwin(void)
// Avoid command-line window first character being concealed.
curwin->w_p_cole = 0;
+ // First go back to the original window.
wp = curwin;
set_bufref(&bufref, curbuf);
win_goto(old_curwin);
+
+ // win_goto() may trigger an autocommand that already closes the
+ // cmdline window.
if (win_valid(wp) && wp != curwin) {
win_close(wp, true, false);
}