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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user