Skip to content

Commit

Permalink
Fix multi-key shortcuts (zed-industries#13606)
Browse files Browse the repository at this point in the history
Broken by the shift shift support PR

Release Notes:

- Fix multi-key shortcuts (preview only)
  • Loading branch information
ConradIrwin authored Jun 27, 2024
1 parent 7d7fd7d commit e1fbef0
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions crates/gpui/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3201,13 +3201,7 @@ impl<'a> WindowContext<'a> {
} else if event.modifiers.number_of_modifiers() == 1 {
self.window.pending_modifiers = Some(event.modifiers);
}
if keystroke.is_none() {
self.finish_dispatch_key_event(event, dispatch_path);
return;
}
}

if let Some(key_down_event) = event.downcast_ref::<KeyDownEvent>() {
} else if let Some(key_down_event) = event.downcast_ref::<KeyDownEvent>() {
self.window.pending_modifiers.take();
let KeymatchResult {
bindings: key_down_bindings,
Expand All @@ -3224,6 +3218,11 @@ impl<'a> WindowContext<'a> {
pending = key_down_pending;
}

if keystroke.is_none() {
self.finish_dispatch_key_event(event, dispatch_path);
return;
}

if pending {
let mut currently_pending = self.window.pending_input.take().unwrap_or_default();
if currently_pending.focus.is_some() && currently_pending.focus != self.window.focus {
Expand Down

0 comments on commit e1fbef0

Please sign in to comment.