helix-mirror/helix-term
Michael Jones d8abd1eaf3
Sort themes, language & files by score & then name (#2675)
* Sort themes by score & then name

Previously the themes were appearing unordered after typing ':theme '.
This sorts them first by fuzzy score and then by name so that they
generally appear in a more ordered fashion in the initial list.

The sort by name does not really pay off when there is a score so an
alternative approach would be to sort by name if there is string to
fuzzy match against and otherwise sort by score.

I've lowercased the names as that avoids lower case & upper case letters
being sorted into separate groups. There might be a preferable approach
to that though.

* Sort language & files by score then name

And change to use sort_unstable_by instead of sort_unstable_by_key as it
allows us to avoid some allocations.

I don't fully understand the flow of the 'filename_impl' function but
this seems to deliver the desired results.

* Remove unnecessary reference

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>

Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2022-07-01 18:33:52 +09:00
..
src Sort themes, language & files by score & then name (#2675) 2022-07-01 18:33:52 +09:00
tests replace phrase in tests 2022-06-19 00:00:31 -04:00
.gitignore Initial import. 2020-05-20 18:14:51 +09:00
build.rs publish a source tarball with version and grammars (#1875) 2022-03-29 14:34:19 +09:00
Cargo.toml build(deps): bump indoc from 1.0.3 to 1.0.6 (#2898) 2022-06-28 18:25:17 +09:00