Merge pull request #17191 from zeertzjq/vim-8.2.4203

vim-patch:8.2.4203: entering a character with CTRL-V may include modifiers
This commit is contained in:
bfredl
2022-01-27 09:00:01 +01:00
committed by GitHub
4 changed files with 81 additions and 11 deletions

View File

@@ -5635,8 +5635,12 @@ int get_literal(void)
i = 0;
for (;;) {
nc = plain_vgetc();
if (!(State & CMDLINE)
&& MB_BYTE2LEN_CHECK(nc) == 1) {
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;
}
if (!(State & CMDLINE) && MB_BYTE2LEN_CHECK(nc) == 1) {
add_to_showcmd(nc);
}
if (nc == 'x' || nc == 'X') {
@@ -5702,6 +5706,8 @@ int get_literal(void)
--no_mapping;
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;