From 74223c1b009662840de04fde6bfcc9ba4780fddf Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Thu, 21 Nov 2024 09:05:00 -0700 Subject: [PATCH] vim: Fix shortcuts that require shift+punct (#20990) Fixes a bug I introduced in #20953 Release Notes: - N/A --- crates/gpui/src/platform/mac/events.rs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/gpui/src/platform/mac/events.rs b/crates/gpui/src/platform/mac/events.rs index f715dba562..e1aae9db39 100644 --- a/crates/gpui/src/platform/mac/events.rs +++ b/crates/gpui/src/platform/mac/events.rs @@ -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() @@ -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 } };