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.

Add ability to keybind search filter (#30327)

Tristan Hume11b6ce46e213
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index b24cb9c9730..8485d8e7919 100644
--- a/crates/search/src/project_search.rs
+++ b/crates/search/src/project_search.rs
@@ -988,6 +988,12 @@ impl ProjectSearchView {
if let Some(query) = query {
search.set_query(&query, window, cx);
}
+ if let Some(included_files) = action.included_files.as_deref() {
+ search
+ .included_files_editor
+ .update(cx, |editor, cx| editor.set_text(included_files, window, cx));
+ search.filters_enabled = true;
+ }
search.focus_query_editor(window, cx)
});
}
diff --git a/crates/workspace/src/pane.rs b/crates/workspace/src/pane.rs
index c8129701e91..543ec5186b1 100644
--- a/crates/workspace/src/pane.rs
+++ b/crates/workspace/src/pane.rs
@@ -154,6 +154,8 @@ pub struct RevealInProjectPanel {
pub struct DeploySearch {
#[serde(default)]
pub replace_enabled: bool,
+ #[serde(default)]
+ pub included_files: Option<String>,
}
impl_actions!(
@@ -200,6 +202,7 @@ impl DeploySearch {
pub fn find() -> Self {
Self {
replace_enabled: false,
+ included_files: None,
}
}
}
@@ -3116,6 +3119,7 @@ fn default_render_tab_bar_buttons(
"Search Project",
DeploySearch {
replace_enabled: false,
+ included_files: None,
}
.boxed_clone(),
)