From 0384456e7d05526dc9b81124ae15a62ddaa6c9bd Mon Sep 17 00:00:00 2001 From: Mikayla Maki Date: Thu, 9 Mar 2023 16:18:37 -0800 Subject: [PATCH] Change context matcher to search the entire stack --- crates/gpui/src/keymap_matcher/keymap_context.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/gpui/src/keymap_matcher/keymap_context.rs b/crates/gpui/src/keymap_matcher/keymap_context.rs index bbf6bfc14bad820cd95c1525c5b673f8b8c04dcc..fbaaa5fbc5d1cb9f7f111fbdeb83a8447ee6992b 100644 --- a/crates/gpui/src/keymap_matcher/keymap_context.rs +++ b/crates/gpui/src/keymap_matcher/keymap_context.rs @@ -64,7 +64,13 @@ impl KeymapContextPredicate { pub fn eval(&self, contexts: &[KeymapContext]) -> bool { let Some(context) = contexts.first() else { return false }; match self { - Self::Identifier(name) => (&context.set).contains(name.as_str()), + Self::Identifier(name) => { + if (&context.set).contains(name.as_str()) { + true + } else { + self.eval(&contexts[1..]) + } + } Self::Equal(left, right) => context .map .get(left.as_str())