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

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

@@ -2910,6 +2910,25 @@ find_special_key(
return 0;
}
/*
* 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>.
*/
int
may_remove_shift_modifier(int modifiers, int key)
{
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 <= '~')))
return modifiers & ~MOD_MASK_SHIFT;
return modifiers;
}
/*
* Try to include modifiers in the key.
* Changes "Shift-a" to 'A', "Alt-A" to 0xc0, etc.