diff --git a/crates/gpui/src/keymap.rs b/crates/gpui/src/keymap.rs index 31313107f60418ff5bb190aef858b07f21bc4d50..003e8027ed077f571d4edb6e9b072f0edeb635c6 100644 --- a/crates/gpui/src/keymap.rs +++ b/crates/gpui/src/keymap.rs @@ -242,12 +242,13 @@ impl Keymap { (bindings, !pending.is_empty()) } /// Check if the given binding is enabled, given a certain key context. - /// Returns the deepest depth at which the binding matches, or None if it doesn't match. - fn binding_enabled(binding: &KeyBinding, contexts: &[KeyContext]) -> Option { + /// Returns the deepest depth at which the binding matches, 0 for globally + /// matching bindings or None if it doesn't match. + pub fn binding_enabled(binding: &KeyBinding, contexts: &[KeyContext]) -> Option { if let Some(predicate) = &binding.context_predicate { predicate.depth_of(contexts) } else { - Some(contexts.len()) + Some(0) } }