From 3627ff87f008776ac1b63a42b0f4023374ce452f Mon Sep 17 00:00:00 2001 From: Marshall Bowers Date: Mon, 4 Dec 2023 15:53:38 -0500 Subject: [PATCH] Ensure the candidate keybinding matches the correct context --- crates/gpui2/src/key_dispatch.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/gpui2/src/key_dispatch.rs b/crates/gpui2/src/key_dispatch.rs index 5fbf83bfbab8e45320ee856fd7542298abdc9649..1ab99ec487854b0081a960c5554635bcef58d014 100644 --- a/crates/gpui2/src/key_dispatch.rs +++ b/crates/gpui2/src/key_dispatch.rs @@ -167,7 +167,10 @@ impl DispatchTree { self.keymap .lock() .bindings_for_action(action.type_id()) - .filter(|candidate| candidate.action.partial_eq(action)) + .filter(|candidate| { + candidate.action.partial_eq(action) + && candidate.matches_context(&self.context_stack) + }) .cloned() .collect() }