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.

search: Remove newlines from query used for tab_content. (#3976)

Piotr Osiewiczd3749531808f
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index 5cdf614c1b9..6fd66b5bad2 100644
--- a/crates/search/src/project_search.rs
+++ b/crates/search/src/project_search.rs
@@ -424,7 +424,8 @@ impl Item for ProjectSearchView {
.current()
.as_ref()
.map(|query| {
- let query_text = util::truncate_and_trailoff(query, MAX_TAB_TITLE_LEN);
+ let query = query.replace('\n', "");
+ let query_text = util::truncate_and_trailoff(&query, MAX_TAB_TITLE_LEN);
query_text.into()
});
let tab_name = last_query