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.

Clean up outline selections when its modal gets closed

Kirill Bulatov2ca17bd03ea8
diff --git a/crates/outline/src/outline.rs b/crates/outline/src/outline.rs
index 75d1a093573..a661a693b1f 100644
--- a/crates/outline/src/outline.rs
+++ b/crates/outline/src/outline.rs
@@ -54,7 +54,13 @@ impl FocusableView for OutlineView {
}
impl EventEmitter<DismissEvent> for OutlineView {}
-impl ModalView for OutlineView {}
+impl ModalView for OutlineView {
+ fn on_before_dismiss(&mut self, cx: &mut ViewContext<Self>) -> bool {
+ self.picker
+ .update(cx, |picker, cx| picker.delegate.restore_active_editor(cx));
+ true
+ }
+}
impl Render for OutlineView {
fn render(&mut self, _cx: &mut ViewContext<Self>) -> impl IntoElement {