mirror of
https://github.com/charmbracelet/gum
synced 2024-05-17 21:56:42 +02: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 a new issue