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.

Reset search index on mode change

Piotr Osiewicz17d505bb7b0d
diff --git a/crates/search/src/project_search.rs b/crates/search/src/project_search.rs
index 45b50dbe34a..52797aa8db3 100644
--- a/crates/search/src/project_search.rs
+++ b/crates/search/src/project_search.rs
@@ -695,6 +695,7 @@ impl ProjectSearchView {
match mode {
SearchMode::Semantic => {
let has_permission = self.semantic_permissioned(cx);
+ self.active_match_index = None;
cx.spawn(|this, mut cx| async move {
let has_permission = has_permission.await?;
@@ -740,11 +741,9 @@ impl ProjectSearchView {
anyhow::Ok(())
}).detach_and_log_err(cx);
}
- SearchMode::Regex => {
- self.semantic_state = None;
- }
- SearchMode::Text => {
+ SearchMode::Regex | SearchMode::Text => {
self.semantic_state = None;
+ self.active_match_index = None;
}
}
cx.notify();