mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-24 02:46:43 +00:00
Remove redundant scopes and actions to fix the focus toggle on ESC
co-authored-by: Antonio <antonio@zed.dev>
This commit is contained in:
parent
93705cbe55
commit
18e0ee44a6
3 changed files with 16 additions and 9 deletions
|
@ -191,7 +191,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"context": "BufferSearchBar > Editor",
|
"context": "BufferSearchBar",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"escape": "buffer_search::Dismiss",
|
"escape": "buffer_search::Dismiss",
|
||||||
"tab": "buffer_search::FocusEditor",
|
"tab": "buffer_search::FocusEditor",
|
||||||
|
@ -200,13 +200,13 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"context": "ProjectSearchBar > Editor",
|
"context": "ProjectSearchBar",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"escape": "project_search::ToggleFocus"
|
"escape": "project_search::ToggleFocus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"context": "ProjectSearchView > Editor",
|
"context": "ProjectSearchView",
|
||||||
"bindings": {
|
"bindings": {
|
||||||
"escape": "project_search::ToggleFocus"
|
"escape": "project_search::ToggleFocus"
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,19 @@ pub struct Binding {
|
||||||
context_predicate: Option<KeymapContextPredicate>,
|
context_predicate: Option<KeymapContextPredicate>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl std::fmt::Debug for Binding {
|
||||||
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
|
write!(
|
||||||
|
f,
|
||||||
|
"Binding {{ keystrokes: {:?}, action: {}::{}, context_predicate: {:?} }}",
|
||||||
|
self.keystrokes,
|
||||||
|
self.action.namespace(),
|
||||||
|
self.action.name(),
|
||||||
|
self.context_predicate
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Clone for Binding {
|
impl Clone for Binding {
|
||||||
fn clone(&self) -> Self {
|
fn clone(&self) -> Self {
|
||||||
Self {
|
Self {
|
||||||
|
|
|
@ -234,7 +234,6 @@ pub fn init(app_state: Arc<AppState>, cx: &mut AppContext) {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
cx.add_action(Workspace::toggle_sidebar_item);
|
cx.add_action(Workspace::toggle_sidebar_item);
|
||||||
cx.add_action(Workspace::focus_center);
|
|
||||||
cx.add_action(|workspace: &mut Workspace, _: &ActivatePreviousPane, cx| {
|
cx.add_action(|workspace: &mut Workspace, _: &ActivatePreviousPane, cx| {
|
||||||
workspace.activate_previous_pane(cx)
|
workspace.activate_previous_pane(cx)
|
||||||
});
|
});
|
||||||
|
@ -1415,11 +1414,6 @@ impl Workspace {
|
||||||
cx.notify();
|
cx.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn focus_center(&mut self, _: &menu::Cancel, cx: &mut ViewContext<Self>) {
|
|
||||||
cx.focus_self();
|
|
||||||
cx.notify();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn add_pane(&mut self, cx: &mut ViewContext<Self>) -> ViewHandle<Pane> {
|
fn add_pane(&mut self, cx: &mut ViewContext<Self>) -> ViewHandle<Pane> {
|
||||||
let pane = cx.add_view(|cx| {
|
let pane = cx.add_view(|cx| {
|
||||||
Pane::new(
|
Pane::new(
|
||||||
|
|
Loading…
Reference in a new issue