outline_panel: Fix j and k not working in outline panel filter (#17293)
Some checks are pending
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Create a Linux bundle (push) Blocked by required conditions
CI / Create arm64 Linux bundle (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run

Closes #17248

Release Notes:

- Fixed outline panel filter not working for certain Vim bindings
([#17248](https://github.com/zed-industries/zed/issues/17248))
This commit is contained in:
CharlesChen0823 2024-09-04 17:27:07 +08:00 committed by GitHub
parent 5b0d64890f
commit 072513f59f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 4 deletions

View file

@ -521,7 +521,7 @@
}
},
{
"context": "OutlinePanel",
"context": "OutlinePanel && not_editing",
"bindings": {
"escape": "menu::Cancel",
"left": "outline_panel::CollapseSelectedEntry",

View file

@ -528,7 +528,7 @@
}
},
{
"context": "OutlinePanel",
"context": "OutlinePanel && not_editing",
"bindings": {
"escape": "menu::Cancel",
"left": "outline_panel::CollapseSelectedEntry",

View file

@ -489,7 +489,7 @@
}
},
{
"context": "OutlinePanel",
"context": "OutlinePanel && not_editing",
"bindings": {
"j": "menu::SelectNext",
"k": "menu::SelectPrev",

View file

@ -722,10 +722,16 @@ impl OutlinePanel {
);
}
fn dispatch_context(&self, _: &ViewContext<Self>) -> KeyContext {
fn dispatch_context(&self, cx: &ViewContext<Self>) -> KeyContext {
let mut dispatch_context = KeyContext::new_with_defaults();
dispatch_context.add("OutlinePanel");
dispatch_context.add("menu");
let identifier = if self.filter_editor.focus_handle(cx).is_focused(cx) {
"editing"
} else {
"not_editing"
};
dispatch_context.add(identifier);
dispatch_context
}