Dismiss outline view when the query editor is blurred

Antonio Scandurra and Nathan Sobo created

Co-Authored-By: Nathan Sobo <nathan@zed.dev>

Change summary

crates/go_to_line/src/go_to_line.rs | 2 --
crates/outline/src/outline.rs       | 1 +
2 files changed, 1 insertion(+), 2 deletions(-)

Detailed changes

crates/go_to_line/src/go_to_line.rs 🔗

@@ -224,6 +224,4 @@ impl View for GoToLine {
     fn on_focus(&mut self, cx: &mut ViewContext<Self>) {
         cx.focus(&self.line_editor);
     }
-
-    fn on_blur(&mut self, _: &mut ViewContext<Self>) {}
 }

crates/outline/src/outline.rs 🔗

@@ -258,6 +258,7 @@ impl OutlineView {
         cx: &mut ViewContext<Self>,
     ) {
         match event {
+            editor::Event::Blurred => cx.emit(Event::Dismissed),
             editor::Event::Edited => self.update_matches(cx),
             _ => {}
         }