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.

project_search: use search history's current entry as a tab name.

Piotr Osiewicz67a48ec1068e
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index dada928d6e2..196d5589f4d 100644
--- a/crates/search/src/project_search.rs
+++ b/crates/search/src/project_search.rs
@@ -499,10 +499,14 @@ impl Item for ProjectSearchView {
.with_margin_right(tab_theme.spacing),
)
.with_child({
- let tab_name: Option<Cow<_>> =
- self.model.read(cx).active_query.as_ref().map(|query| {
- let query_text =
- util::truncate_and_trailoff(query.as_str(), MAX_TAB_TITLE_LEN);
+ let tab_name: Option<Cow<_>> = self
+ .model
+ .read(cx)
+ .search_history
+ .current()
+ .as_ref()
+ .map(|query| {
+ let query_text = util::truncate_and_trailoff(query, MAX_TAB_TITLE_LEN);
query_text.into()
});
Label::new(