mirror of
https://github.com/zed-industries/zed.git
synced 2024-09-20 02:47:34 +03:00
Go back to previous mode on rejection of semantic indexing
This commit is contained in:
parent
d34da2db69
commit
8b033223fb
@ -685,6 +685,10 @@ impl ProjectSearchView {
|
||||
}
|
||||
|
||||
fn activate_search_mode(&mut self, mode: SearchMode, cx: &mut ViewContext<Self>) {
|
||||
let previous_mode = self.current_mode;
|
||||
if previous_mode == mode {
|
||||
return;
|
||||
}
|
||||
self.model.update(cx, |model, _| model.kill_search());
|
||||
self.current_mode = mode;
|
||||
|
||||
@ -722,7 +726,8 @@ impl ProjectSearchView {
|
||||
} else {
|
||||
this.update(&mut cx, |this, cx| {
|
||||
this.semantic_permissioned = Some(false);
|
||||
this.activate_search_mode(SearchMode::Regex, cx);
|
||||
debug_assert_ne!(previous_mode, SearchMode::Semantic, "Tried to re-enable semantic search mode after user modal was rejected");
|
||||
this.activate_search_mode(previous_mode, cx);
|
||||
})?;
|
||||
return anyhow::Ok(());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user