Skip to content

Commit

Permalink
vim: Fix shortcuts that require shift+punct (cherry-pick #20990) (#20992
Browse files Browse the repository at this point in the history
)

Cherry-picked vim: Fix shortcuts that require shift+punct (#20990)

Fixes a bug I introduced in #20953

Release Notes:

- N/A

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
  • Loading branch information
gcp-cherry-pick-bot[bot] and ConradIrwin authored Nov 21, 2024
1 parent 21b1a05 commit a882efe
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions crates/gpui/src/platform/mac/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,18 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke {
chars_ignoring_modifiers = chars_with_cmd;
}

if !control && !command && !function {
let mut mods = NO_MOD;
if shift {
mods |= SHIFT_MOD;
}
if alt {
mods |= OPTION_MOD;
}

key_char = Some(chars_for_modified_key(native_event.keyCode(), mods));
}

let mut key = if shift
&& chars_ignoring_modifiers
.chars()
Expand All @@ -354,18 +366,6 @@ unsafe fn parse_keystroke(native_event: id) -> Keystroke {
chars_ignoring_modifiers
};

if !control && !command && !function {
let mut mods = NO_MOD;
if shift {
mods |= SHIFT_MOD;
}
if alt {
mods |= OPTION_MOD;
}

key_char = Some(chars_for_modified_key(native_event.keyCode(), mods));
}

key
}
};
Expand Down

0 comments on commit a882efe

Please sign in to comment.