patch 8.2.4203: entering a character with CTRL-V may include modifiers
Problem: Entering a character with CTRL-V may include modifiers.
Solution: Reset "mod_mask" when entering a character with digits after
CTRL-V. (closes #9610)
diff --git a/src/edit.c b/src/edit.c
index 0363129..ee3caf0 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -1909,6 +1909,11 @@
if ((nc == ESC || nc == CSI) && !noReduceKeys)
nc = decodeModifyOtherKeys(nc);
+ if ((mod_mask & ~MOD_MASK_SHIFT) != 0)
+ // A character with non-Shift modifiers should not be a valid
+ // character for i_CTRL-V_digit.
+ break;
+
#ifdef FEAT_CMDL_INFO
if (!(State & CMDLINE) && MB_BYTE2LEN_CHECK(nc) == 1)
add_to_showcmd(nc);
@@ -1986,7 +1991,11 @@
--allow_keys;
#endif
if (nc)
+ {
vungetc(nc);
+ // A character typed with i_CTRL-V_digit cannot have modifiers.
+ mod_mask = 0;
+ }
got_int = FALSE; // CTRL-C typed after CTRL-V is not an interrupt
return cc;
}