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)
c9e8fd6fc7

Code is already present in Nvim. Add some other related missing changes.
This commit is contained in:
zeertzjq
2022-07-27 06:19:59 +08:00
parent 9f1dc1466e
commit 0c0a2e4e52
4 changed files with 109 additions and 91 deletions

View File

@@ -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);
}