diff --git a/cvpcb/cvpcb_mainframe.cpp b/cvpcb/cvpcb_mainframe.cpp index f12b9d1757..1d12abe94e 100644 --- a/cvpcb/cvpcb_mainframe.cpp +++ b/cvpcb/cvpcb_mainframe.cpp @@ -991,8 +991,19 @@ void CVPCB_MAINFRAME::BuildLibrariesList() COMMON_SETTINGS* cfg = Pgm().GetCommonSettings(); PROJECT_FILE& project = Kiway().Prj().GetProjectFile(); FP_LIB_TABLE* tbl = PROJECT_PCB::PcbFootprintLibs( &Prj() ); - std::set pinnedMatches; - std::set otherMatches; + + // Use same sorting algorithm as LIB_TREE_NODE::AssignIntrinsicRanks + struct library_sort + { + bool operator()( const wxString& lhs, const wxString& rhs ) const + { + return StrNumCmp( lhs, rhs, true ) < 0; + } + }; + + std::set pinnedMatches; + std::set otherMatches; + m_librariesListBox->ClearList(); auto process =