Reset search index on mode change

This commit is contained in:
Piotr Osiewicz
2023-08-09 14:25:56 +02:00
parent 28a57662af
commit 17d505bb7b
+3 -4
View File
@@ -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();