mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-02 00:06:08 +00:00
Ignore buffer search events if it's not for the current buffer
This commit is contained in:
parent
65be909378
commit
1e6757755e
1 changed files with 6 additions and 2 deletions
|
@ -473,7 +473,9 @@ impl<T: 'static> 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::<BufferSearchBar>() {
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue