Dismiss outline view when the query editor is blurred

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-01-14 17:25:24 +01:00
parent b52db22544
commit e4c0fc6ad5
2 changed files with 1 additions and 2 deletions

View file

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

View file

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