aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-04-03 08:58:49 +0800
committerGitHub <noreply@github.com>2022-04-03 08:58:49 +0800
commita783cdd68d4f2d282725ea60e869ddf639930dc3 (patch)
tree5bb97783e558fc81fe65fc4926934effbdcbb68f /src
parent2a466001401c5a6d67ca9e33ae9630939150d09f (diff)
downloadrneovim-a783cdd68d4f2d282725ea60e869ddf639930dc3.tar.gz
rneovim-a783cdd68d4f2d282725ea60e869ddf639930dc3.tar.bz2
rneovim-a783cdd68d4f2d282725ea60e869ddf639930dc3.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/nvim/getchar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index b12b99b7ee..c944a5ec93 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -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;