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

Fixes https://github.com/zed-industries/community/issues/2388
Release Notes:

- Fixed tab content of project search overflowing the tab for queries
with newlines.
This commit is contained in:
Piotr Osiewicz 2024-01-09 17:16:25 +01:00 committed by GitHub
parent f0ef63bfa0
commit d374953180
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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