mirror of
https://github.com/charmbracelet/gum.git
synced 2024-08-17 02:00:46 +03:00
fix "shuffling"
This commit is contained in:
parent
d74f126d41
commit
d45b728b4d
@ -11,6 +11,7 @@
|
||||
package filter
|
||||
|
||||
import (
|
||||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/charmbracelet/bubbles/textinput"
|
||||
@ -274,6 +275,13 @@ func exactMatches(search string, matches []fuzzy.Match) []fuzzy.Match {
|
||||
exactMatches = append(exactMatches, m)
|
||||
}
|
||||
}
|
||||
|
||||
// we need to sort by name the matches because
|
||||
// they are sorted with the fuzzy ranking
|
||||
sort.Slice(exactMatches, func(i, j int) bool {
|
||||
return exactMatches[i].Str > exactMatches[j].Str
|
||||
})
|
||||
|
||||
return exactMatches
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user