Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
search: Add a default tooltip for empty searches
Piotr Osiewicze1a6dc90770a
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rsindex 2c22517e204..0f8c9173bc3 100644--- a/crates/search/src/project_search.rs+++ b/crates/search/src/project_search.rs@@ -25,7 +25,7 @@ use std::{borrow::Cow,collections::HashSet,mem,- ops::Range,+ ops::{Not, Range},path::PathBuf,sync::Arc,};@@ -242,7 +242,13 @@ impl View for ProjectSearchView {impl Item for ProjectSearchView {fn tab_tooltip_text(&self, cx: &AppContext) -> Option<Cow<str>> {- Some(self.query_editor.read(cx).text(cx).into())+ let query_text = self.query_editor.read(cx).text(cx);++ query_text+ .is_empty()+ .not()+ .then(|| query_text.into())+ .or_else(|| Some("Project search".into()))}fn act_as_type<'a>(