From 99ef8ccd3fc77477aae43a181a181e3ff8da59d2 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Mon, 20 Nov 2023 19:07:37 +0100 Subject: [PATCH] fixup dismissing of search bar --- crates/search2/src/buffer_search.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/search2/src/buffer_search.rs b/crates/search2/src/buffer_search.rs index 77b80e9ac8..af876f807a 100644 --- a/crates/search2/src/buffer_search.rs +++ b/crates/search2/src/buffer_search.rs @@ -71,6 +71,9 @@ impl Render for BufferSearchBar { // } else { // theme.search.editor.input.container // }; + if self.dismissed { + return div(); + } let supported_options = self.supported_options(); let previous_query_keystrokes = cx @@ -292,7 +295,13 @@ impl BufferSearchBar { workspace.active_pane().update(cx, |this, cx| { this.toolbar().update(cx, |this, cx| { if let Some(search_bar) = this.item_of_type::() { - search_bar.update(cx, |this, cx| this.dismiss(&Dismiss, cx)); + search_bar.update(cx, |this, cx| { + if this.is_dismissed() { + this.show(cx); + } else { + this.dismiss(&Dismiss, cx); + } + }); return; } let view = cx.build_view(|cx| BufferSearchBar::new(cx));