summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-10-31 16:33:47 +0100
committerBram Moolenaar <Bram@vim.org>2020-10-31 16:33:47 +0100
commit749bc9521d9c1b3b3250faef25a3710206cf277d (patch)
tree6a40e4e5c2eee9012439dfe042cb4606613fa10f /src/term.c
parent0289065e41ce3148f929e16a55aa3b161c80576f (diff)
downloadvim-git-749bc9521d9c1b3b3250faef25a3710206cf277d.tar.gz
patch 8.2.1930: wrong input if removing shift results in special key codev8.2.1930
Problem: Wrong input if removing shift results in special key code. Solution: Handle special key codes. (closes #7189)
Diffstat (limited to 'src/term.c')
-rw-r--r--src/term.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/term.c b/src/term.c
index 4d4cc589d..56f6e0a93 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4462,7 +4462,8 @@ modifiers2keycode(int modifiers, int *key, char_u *string)
if (modifiers != 0)
{
// Some keys have the modifier included. Need to handle that here to
- // make mappings work.
+ // make mappings work. This may result in a special key, such as
+ // K_S_TAB.
*key = simplify_key(*key, &modifiers);
if (modifiers != 0)
{
@@ -4793,7 +4794,13 @@ handle_key_with_modifier(
// insert modifiers with KS_MODIFIER
new_slen = modifiers2keycode(modifiers, &key, string);
- if (has_mbyte)
+ if (IS_SPECIAL(key))
+ {
+ string[new_slen++] = K_SPECIAL;
+ string[new_slen++] = KEY2TERMCAP0(key);
+ string[new_slen++] = KEY2TERMCAP1(key);
+ }
+ else if (has_mbyte)
new_slen += (*mb_char2bytes)(key, string + new_slen);
else
string[new_slen++] = key;