From 74b8f14ec3e7a85356aa3c47c01fe038d2617cf2 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sat, 4 Sep 2021 23:48:06 -0400 Subject: [PATCH] Don't find when the dialog isn't open or the search is blank (which resulted in full highlighting) Fix #9056 --- eeschema/tools/sch_editor_control.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 4ffbc1d734..95477247ff 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -250,7 +250,12 @@ int SCH_EDITOR_CONTROL::UpdateFind( const TOOL_EVENT& aEvent ) auto visit = [&]( EDA_ITEM* aItem, SCH_SHEET_PATH* aSheet ) { - if( aItem->Matches( data, aSheet ) ) + // We may get triggered when the dialog is not opened due to binding SelectedItemsModified + // we also get triggered when the find dialog is closed....so we need to double check the dialog is open + + if( m_frame->m_findReplaceDialog != nullptr + && !data.GetFindString().IsEmpty() + && aItem->Matches( data, aSheet ) ) { aItem->SetForceVisible( true ); m_selectionTool->BrightenItem( aItem );