Skip to content

Commit

Permalink
Fix #61
Browse files Browse the repository at this point in the history
  • Loading branch information
Shizcow committed Nov 15, 2023
1 parent 52258bb commit 1f56a86
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/plugins/fuzzy/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ impl Drw {
})
}).collect();
items.retain(|(_, score)| *score <= 0);
items.sort_by_key(|(item, _)| item.text.len()); // this prioritizes exact matches
items.sort_by_key(|(_, score)| *score);
if searchterm.len() > 0 {
items.sort_by_key(|(item, _)| item.text.len()); // this prioritizes exact matches
items.sort_by_key(|(_, score)| *score);
}

Ok(items.into_iter().map(|(item, _)| item).collect())
}
Expand Down

0 comments on commit 1f56a86

Please sign in to comment.