1
0
forked from aniani/vim

patch 8.2.1019: mapping <M-S-a> does not work in the GUI

Problem:    Mapping <M-S-a> does not work in the GUI.
Solution:   Move the logic to remove the shift modifier to
            may_remove_shift_modifier() and also use it in the GUI.
This commit is contained in:
Bram Moolenaar
2020-06-20 14:43:23 +02:00
parent 280b0dc815
commit ef6746f637
5 changed files with 32 additions and 14 deletions

View File

@@ -4769,17 +4769,8 @@ handle_key_with_modifier(
modifiers = decode_modifiers(arg[1]);
// 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.
// Also for <A-S-a> and <M-S-a>.
if ((modifiers == MOD_MASK_SHIFT
|| modifiers == (MOD_MASK_SHIFT | MOD_MASK_ALT)
|| modifiers == (MOD_MASK_SHIFT | MOD_MASK_META))
&& ((key >= '@' && key <= 'Z')
|| key == '^' || key == '_'
|| (key >= '{' && key <= '~')))
modifiers &= ~MOD_MASK_SHIFT;
// May remove the shift modifier if it's already included in the key.
modifiers = may_remove_shift_modifier(modifiers, key);
// When used with Ctrl we always make a letter upper case,
// so that mapping <C-H> and <C-h> are the same. Typing