Prefer first max while fuzzy matching projects fixes unexpected behavior

This commit is contained in:
Julia 2023-01-05 11:27:50 -05:00
parent 79f8f08caf
commit 09d57d1f26

View file

@ -146,6 +146,7 @@ impl PickerDelegate for RecentProjectsView {
.matches .matches
.iter() .iter()
.enumerate() .enumerate()
.rev()
.max_by_key(|(_, m)| OrderedFloat(m.score)) .max_by_key(|(_, m)| OrderedFloat(m.score))
.map(|(ix, _)| ix) .map(|(ix, _)| ix)
.unwrap_or(0); .unwrap_or(0);