0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

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)
This commit is contained in:
zeertzjq
2022-01-24 15:27:50 +00:00
committed by Bram Moolenaar
parent acc4b5648b
commit 502d8ae3e8
3 changed files with 28 additions and 4 deletions

View File

@@ -1909,6 +1909,11 @@ get_literal(int noReduceKeys)
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 @@ get_literal(int noReduceKeys)
--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;
}