mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-16 13:34:48 +02:00
Port calls to slices.Sort functions since they now need a cmp() function rather than a less() function
Also rename os.SEEK_* to io.Seek* as the former has been deprecated
This commit is contained in:
@@ -308,12 +308,12 @@ func (self *Command) GetVisibleOptions() ([]string, map[string][]*Option) {
|
||||
}
|
||||
|
||||
func sort_levenshtein_matches(q string, matches []string) {
|
||||
utils.StableSort(matches, func(a, b string) bool {
|
||||
utils.StableSort(matches, func(a, b string) int {
|
||||
la, lb := utils.LevenshteinDistance(a, q, true), utils.LevenshteinDistance(b, q, true)
|
||||
if la != lb {
|
||||
return la < lb
|
||||
return la - lb
|
||||
}
|
||||
return a < b
|
||||
return strings.Compare(a, b)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user