Fixed a bug where the command palette wouldn't check the keymap context when showing available actions
Fixed a bug where context menus wouldn't show action keystrokes WIP Fixing a bug where tooltips won't show action keystrokes Co-Authored-By: Max <max@zed.dev>
This commit is contained in:
parent
37bfeed2e6
commit
926b59b15d
7 changed files with 80 additions and 44 deletions
|
@ -41,7 +41,7 @@ impl Binding {
|
|||
})
|
||||
}
|
||||
|
||||
fn match_context(&self, contexts: &[KeymapContext]) -> bool {
|
||||
pub fn match_context(&self, contexts: &[KeymapContext]) -> bool {
|
||||
self.context_predicate
|
||||
.as_ref()
|
||||
.map(|predicate| predicate.eval(contexts))
|
||||
|
|
|
@ -43,7 +43,7 @@ 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) => (&context.set).contains(name.as_str()),
|
||||
Self::Equal(left, right) => context
|
||||
.map
|
||||
.get(left)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue