Sort equally-scored search results by caption.

master
Pacman Ghost 5 years ago
parent b947a5fba9
commit 68733469ae
  1. 7
      src/MainForm.cs

@ -140,7 +140,12 @@ public partial class MainForm : Form
// sort the search results
results.Sort( (lhs, rhs) => {
return (lhs.Item2 == rhs.Item2) ? 0 : (lhs.Item2 > rhs.Item2) ? -1 : +1 ;
if ( lhs.Item2 < rhs.Item2 )
return +1 ;
else if ( lhs.Item2 > rhs.Item2 )
return -1 ;
// NOTE: We also sort by caption/filename to handle things like "foo-1" vs. "foo-2".
return String.Compare( lhs.Item1.caption(), rhs.Item1.caption() ) ;
} ) ;
if ( searchQuery != "" && logger.IsInfoEnabled ) {
if ( results.Count > 0 ) {

Loading…
Cancel
Save