From 2ca17bd03ea81e4afe386618bef50eecff43046e Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Mon, 8 Jan 2024 21:52:03 +0200 Subject: [PATCH] Clean up outline selections when its modal gets closed --- crates/outline/src/outline.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/outline/src/outline.rs b/crates/outline/src/outline.rs index 75d1a09357..a661a693b1 100644 --- a/crates/outline/src/outline.rs +++ b/crates/outline/src/outline.rs @@ -54,7 +54,13 @@ impl FocusableView for OutlineView { } impl EventEmitter for OutlineView {} -impl ModalView for OutlineView {} +impl ModalView for OutlineView { + fn on_before_dismiss(&mut self, cx: &mut ViewContext) -> 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) -> impl IntoElement {