Skip to content

Commit

Permalink
sort autocompletins by fuzzy match
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe committed Oct 7, 2022
1 parent 6b16b9d commit 63a54ee
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions helix-term/src/ui/menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@ impl<T: Item> Menu<T> {
.map(|score| (index, score))
}),
);
// matches.sort_unstable_by_key(|(_, score)| -score);
self.matches.sort_unstable_by_key(|(index, _score)| {
self.options[*index].sort_text(&self.editor_data)
});
self.matches.sort_unstable_by_key(|(_, score)| -score);

// reset cursor position
self.cursor = None;
Expand Down

0 comments on commit 63a54ee

Please sign in to comment.