Skip to content

Commit

Permalink
vim: Fix shortcuts that require shift+punct (zed-industries#20990)
Browse files Browse the repository at this point in the history
Fixes a bug I introduced in zed-industries#20953

Release Notes:

- N/A
  • Loading branch information
ConradIrwin authored and Anthony-Eid committed Nov 22, 2024
1 parent 9a87ccb commit 593a181
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 593a181

Please sign in to comment.