From 67ba0485812fc4c9cd3e5fa8a2537c0729d040f9 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Thu, 27 Jun 2024 15:32:57 -0600 Subject: [PATCH] Fix multi-key shortcuts (cherry-pick #13606) (#13607) Cherry-picked Fix multi-key shortcuts (#13606) Broken by the shift shift support PR Release Notes: - Fix multi-key shortcuts (preview only) Co-authored-by: Conrad Irwin --- crates/gpui/src/window.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/crates/gpui/src/window.rs b/crates/gpui/src/window.rs index 289e0af16c5150e7836d7deefbc48171a3d11192..c7bb2cf406065e87f199a00c6608aa61e9753fe6 100644 --- a/crates/gpui/src/window.rs +++ b/crates/gpui/src/window.rs @@ -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::() { + } else if let Some(key_down_event) = event.downcast_ref::() { self.window.pending_modifiers.take(); let KeymatchResult { bindings: key_down_bindings, @@ -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 {