Do not dismiss buffer search when any modal is present

Co-authored-by: Piotr Osiewicz <piotr@zed.dev>
This commit is contained in:
Kirill Bulatov
2024-01-09 23:29:05 +02:00
co-authored by Piotr Osiewicz
parent a579ef17d7
commit 8b71b1d07b
3 changed files with 17 additions and 4 deletions
+4
View File
@@ -101,6 +101,10 @@ impl ModalLayer {
let active_modal = self.active_modal.as_ref()?;
active_modal.modal.view().downcast::<V>().ok()
}
pub fn has_active_modal(&self) -> bool {
self.active_modal.is_some()
}
}
impl Render for ModalLayer {
+4
View File
@@ -3383,6 +3383,10 @@ impl Workspace {
div
}
pub fn has_active_modal(&self, cx: &WindowContext<'_>) -> bool {
self.modal_layer.read(cx).has_active_modal()
}
pub fn active_modal<V: ManagedView + 'static>(
&mut self,
cx: &ViewContext<Self>,