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.
diff --git a/src/term.c b/src/term.c
index 1556c2e..3bda87c 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4769,17 +4769,8 @@
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