Dismiss the focused find bar on escape

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-02-04 16:11:48 +01:00
parent ad13bcdbda
commit 7a8765a016

View file

@ -328,10 +328,10 @@ impl FindBar {
}); });
} }
fn dismiss(workspace: &mut Workspace, _: &Dismiss, cx: &mut ViewContext<Workspace>) { fn dismiss(pane: &mut Pane, _: &Dismiss, cx: &mut ViewContext<Pane>) {
workspace if pane.toolbar::<FindBar>().is_some() {
.active_pane() pane.dismiss_toolbar(cx);
.update(cx, |pane, cx| pane.dismiss_toolbar(cx)); }
} }
fn focus_editor(&mut self, _: &FocusEditor, cx: &mut ViewContext<Self>) { fn focus_editor(&mut self, _: &FocusEditor, cx: &mut ViewContext<Self>) {