mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-28 15:44:20 +03:00
project_search: use search history's current entry as a tab name.
Previously the tab name for Semantic Search was not updated, as we didn't have an active query to go off of Co-authored-by: Kyle <kyle@zed.dev>
This commit is contained in:
parent
61041b0cd1
commit
67a48ec106
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user