Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Clear pending keystrokes when finding action

Antonio Scandurrad0b5c654aae5
diff --git a/crates/gpui2/src/key_dispatch.rs b/crates/gpui2/src/key_dispatch.rs
index 6dac90fc596..e44dc51c058 100644
--- a/crates/gpui2/src/key_dispatch.rs
+++ b/crates/gpui2/src/key_dispatch.rs
@@ -202,6 +202,11 @@ impl KeyDispatcher {
if let KeyMatch::Some(action) = keystroke_matcher
.match_keystroke(&key_down_event.keystroke, self.context_stack.as_slice())
{
+ // Clear all pending keystrokes when an action has been found.
+ for keystroke_matcher in self.keystroke_matchers.values_mut() {
+ keystroke_matcher.clear_pending();
+ }
+
self.dispatch_action_on_node(*node_id, action, cx);
if !cx.propagate_event {
return;