Support parital matches for libraries.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16400
This commit is contained in:
parent
922aee1532
commit
df161c9886
|
@ -247,7 +247,7 @@ void LIB_TREE_NODE_ITEM::UpdateScore( EDA_COMBINED_MATCHER* aMatcher, const wxSt
|
|||
m_Score += aMatcher->ScoreTerms( m_SearchTerms );
|
||||
|
||||
// aLib test is additive
|
||||
if( !aLib.IsEmpty() && m_Parent->m_Name.Lower() == aLib )
|
||||
if( !aLib.IsEmpty() && m_Parent->m_Name.Lower().Matches( aLib ) )
|
||||
m_Score += 1;
|
||||
|
||||
// aFilter test is subtractive
|
||||
|
@ -294,7 +294,7 @@ void LIB_TREE_NODE_LIBRARY::UpdateScore( EDA_COMBINED_MATCHER* aMatcher, const w
|
|||
}
|
||||
|
||||
// aLib test is additive
|
||||
if( !aLib.IsEmpty() && m_Name.Lower() == aLib )
|
||||
if( !aLib.IsEmpty() && m_Name.Lower().Matches( aLib ) )
|
||||
m_Score += 1;
|
||||
|
||||
// aMatcher test is additive
|
||||
|
|
|
@ -265,8 +265,8 @@ void LIB_TREE_MODEL_ADAPTER::UpdateSearchString( const wxString& aSearch, bool a
|
|||
}
|
||||
else
|
||||
{
|
||||
// In case the full token happens to be a library name
|
||||
m_tree.UpdateScore( nullptr, term, nullptr );
|
||||
// In case the full token happens to match a library name
|
||||
m_tree.UpdateScore( nullptr, '*' + term + '*', nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue