0
0
mirror of https://github.com/vim/vim.git synced 2025-10-01 04:54:07 -04:00

patch 8.2.1811: mapping Ctrl-key does not work for '{', '}' and '|'

Problem:    Mapping Ctrl-key does not work for '{', '}' and '|'.
Solution:   Remove the shift modifier. (closes #6457)
This commit is contained in:
Bram Moolenaar
2020-10-07 17:29:48 +02:00
parent d7e5e9430a
commit 9a033d7b18
4 changed files with 36 additions and 3 deletions

View File

@@ -2974,7 +2974,8 @@ may_adjust_key_for_ctrl(int modifiers, int key)
/*
* Some keys already have Shift included, pass them as normal keys.
* Not when Ctrl is also used, because <C-H> and <C-S-H> are different.
* When Ctrl is also used <C-H> and <C-S-H> are different, but <C-S-{> should
* be <C-{>. Same for <C-S-}> and <C-S-|>.
* Also for <A-S-a> and <M-S-a>.
* This includes all printable ASCII characters except numbers and a-z.
*/
@@ -2989,6 +2990,11 @@ may_remove_shift_modifier(int modifiers, int key)
|| (key >= '[' && key <= '`')
|| (key >= '{' && key <= '~')))
return modifiers & ~MOD_MASK_SHIFT;
if (modifiers == (MOD_MASK_SHIFT | MOD_MASK_CTRL)
&& (key == '{' || key == '}' || key == '|'))
return modifiers & ~MOD_MASK_SHIFT;
return modifiers;
}