Switched to summing exec and name matches in the Applications plugin
This commit is contained in:
@@ -55,10 +55,14 @@ pub fn get_matches(input: RString, entries: &mut Vec<(DesktopEntry, u64)>) -> RV
|
|||||||
.clone()
|
.clone()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(|(entry, id)| {
|
.filter_map(|(entry, id)| {
|
||||||
matcher
|
let score = matcher.fuzzy_match(&entry.name, &input).unwrap_or(0)
|
||||||
.fuzzy_match(&entry.name, &input)
|
+ matcher.fuzzy_match(&entry.exec, &input).unwrap_or(0);
|
||||||
.max(matcher.fuzzy_match(&entry.exec, &input))
|
|
||||||
.map(|val| (entry, id, val))
|
if score > 0 {
|
||||||
|
Some((entry, id, score))
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user