From 67a48ec1068e2ca1532180913178ae985a8b31f6 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 21 Aug 2023 13:30:32 +0200 Subject: [PATCH] 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 --- crates/search/src/project_search.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs index dada928d6e247f84bd14b52a00f3f32ac6b5f8fd..196d5589f4df881ddd60293d757d9640734f46a2 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> = - 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> = 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(