fix(ex_normal): spam \n in Ex mode only if in Cmdline mode (#17977)

When using :normal in Ex mode, the editor is no longer in Cmdline mode,
but the exmode_active flag is still set, causing the wrong character to
be spammed in Insert mode, leading to a hang.
This commit is contained in:
zeertzjq
2022-04-03 08:58:49 +08:00
committed by GitHub
parent 2a46600140
commit a783cdd68d
2 changed files with 14 additions and 1 deletions

View File

@@ -2330,7 +2330,7 @@ static int vgetorpeek(bool advance)
// cmdline window.
if (p_im && (State & INSERT)) {
c = Ctrl_L;
} else if (exmode_active) {
} else if ((State & CMDLINE) && exmode_active) {
c = '\n';
} else if ((State & CMDLINE) || (cmdwin_type > 0 && tc == ESC)) {
c = Ctrl_C;