mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
fix(keycodes): simplify S- properly when D- is present (#27316)
This commit is contained in:
@@ -758,17 +758,20 @@ static int extract_modifiers(int key, int *modp, const bool simplify, bool *cons
|
||||
{
|
||||
int modifiers = *modp;
|
||||
|
||||
// Command-key and ctrl are special
|
||||
if (!(modifiers & MOD_MASK_CMD) && !(modifiers & MOD_MASK_CTRL)) {
|
||||
if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key)) {
|
||||
key = TOUPPER_ASC(key);
|
||||
if ((modifiers & MOD_MASK_SHIFT) && ASCII_ISALPHA(key)) {
|
||||
key = TOUPPER_ASC(key);
|
||||
// With <C-S-a> we keep the shift modifier.
|
||||
// With <S-a>, <A-S-a> and <S-A> we don't keep the shift modifier.
|
||||
if (!(modifiers & MOD_MASK_CTRL)) {
|
||||
modifiers &= ~MOD_MASK_SHIFT;
|
||||
}
|
||||
}
|
||||
|
||||
// <C-H> and <C-h> mean the same thing, always use "H"
|
||||
if ((modifiers & MOD_MASK_CTRL) && ASCII_ISALPHA(key)) {
|
||||
key = TOUPPER_ASC(key);
|
||||
}
|
||||
|
||||
if (simplify && (modifiers & MOD_MASK_CTRL)
|
||||
&& ((key >= '?' && key <= '_') || ASCII_ISALPHA(key))) {
|
||||
key = CTRL_CHR(key);
|
||||
|
Reference in New Issue
Block a user