From 1e6757755ef5b34089d90aa8733a248fa8afe74f Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Wed, 17 Jan 2024 22:18:54 +0200 Subject: [PATCH] Ignore buffer search events if it's not for the current buffer --- crates/search/src/buffer_search.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/search/src/buffer_search.rs b/crates/search/src/buffer_search.rs index e4a68b6105..fbc7101355 100644 --- a/crates/search/src/buffer_search.rs +++ b/crates/search/src/buffer_search.rs @@ -473,7 +473,9 @@ impl SearchActionsRegistrar for DivRegistrar<'_, '_, T> { .clone() .map(|search_bar| { search_bar.update(cx, |search_bar, cx| { - if search_bar.is_dismissed() { + if search_bar.is_dismissed() + || search_bar.active_searchable_item.is_none() + { false } else { callback(search_bar, action, cx); @@ -538,7 +540,9 @@ impl SearchActionsRegistrar for Workspace { this.toolbar().update(cx, move |this, cx| { if let Some(search_bar) = this.item_of_type::() { let should_notify = search_bar.update(cx, move |search_bar, cx| { - if search_bar.is_dismissed() { + if search_bar.is_dismissed() + || search_bar.active_searchable_item.is_none() + { false } else { callback(search_bar, action, cx);