Ensure search input always has regex language synced with search_options state (#25811)

Follow-up to https://github.com/zed-industries/zed/pull/25797

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov 2025-02-28 15:15:25 +02:00 committed by GitHub
parent 22220ed32e
commit 5740fec9d5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -924,7 +924,7 @@ impl BufferSearchBar {
query_buffer.edit([(0..len, query)], None, cx);
});
});
self.search_options = options;
self.set_search_options(options, cx);
self.clear_matches(window, cx);
cx.notify();
}
@ -978,6 +978,7 @@ impl BufferSearchBar {
pub fn set_search_options(&mut self, search_options: SearchOptions, cx: &mut Context<Self>) {
self.search_options = search_options;
self.adjust_query_regex_language(cx);
cx.notify();
}

View File

@ -894,6 +894,7 @@ impl ProjectSearchView {
editor.set_text(old_query.as_str(), window, cx);
});
search_view.search_options = SearchOptions::from_query(&old_query);
search_view.adjust_query_regex_language(cx);
}
}
new_query