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:
Kovid Goyal
2023-08-04 22:50:13 +05:30
parent 18d48c8dcd
commit 341d845b9a
18 changed files with 60 additions and 34 deletions

View File

@@ -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)
})
}