From 5928d5c2f11754e1d2cc383a1568c3664a38207d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 21 Aug 2022 19:37:11 +0800 Subject: vim-patch:9.0.0234: cannot make difference between :normal end and argument char (#19879) Problem: Cannot make difference between the end of :normal and a character in its argument. Solution: Add the "typebuf_was_empty" flag. (closes vim/vim#10950) https://github.com/vim/vim/commit/8d69637133e17370491b83da8657a15b991c2f76 --- src/nvim/getchar.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/nvim/getchar.c') diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c index add650a430..0f55158733 100644 --- a/src/nvim/getchar.c +++ b/src/nvim/getchar.c @@ -2400,7 +2400,8 @@ static int vgetorpeek(bool advance) vgetc_busy++; if (advance) { - KeyStuffed = FALSE; + KeyStuffed = false; + typebuf_was_empty = false; } init_typebuf(); @@ -2626,6 +2627,11 @@ static int vgetorpeek(bool advance) } tc = c; + // set a flag to indicate this wasn't a normal char + if (advance) { + typebuf_was_empty = true; + } + // return 0 in normal_check() if (pending_exmode_active) { exmode_active = true; -- cgit