Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Restore the ability to navigate into project search input with the keyboard (#20579)

Kirill Bulatov3f224274da77
diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs
index fd7bcbdcd0a..41e5ba28df7 100644
--- a/crates/search/src/buffer_search.rs
+++ b/crates/search/src/buffer_search.rs
@@ -657,6 +657,7 @@ impl BufferSearchBar {
return true;
}
+ cx.propagate();
false
}
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index d4b44a1611c..1f4492d992b 100644
--- a/crates/search/src/project_search.rs
+++ b/crates/search/src/project_search.rs
@@ -1,7 +1,7 @@
use crate::{
- BufferSearchBar, FocusSearch, NextHistoryQuery, PreviousHistoryQuery, ReplaceAll, ReplaceNext,
- SearchOptions, SelectNextMatch, SelectPrevMatch, ToggleCaseSensitive, ToggleIncludeIgnored,
- ToggleRegex, ToggleReplace, ToggleWholeWord,
+ buffer_search::Deploy, BufferSearchBar, FocusSearch, NextHistoryQuery, PreviousHistoryQuery,
+ ReplaceAll, ReplaceNext, SearchOptions, SelectNextMatch, SelectPrevMatch, ToggleCaseSensitive,
+ ToggleIncludeIgnored, ToggleRegex, ToggleReplace, ToggleWholeWord,
};
use collections::{HashMap, HashSet};
use editor::{
@@ -58,6 +58,9 @@ impl Global for ActiveSettings {}
pub fn init(cx: &mut AppContext) {
cx.set_global(ActiveSettings::default());
cx.observe_new_views(|workspace: &mut Workspace, _cx| {
+ register_workspace_action(workspace, move |search_bar, _: &Deploy, cx| {
+ search_bar.focus_search(cx);
+ });
register_workspace_action(workspace, move |search_bar, _: &FocusSearch, cx| {
search_bar.focus_search(cx);
});