Pick the highest rating from matching with the app name and exec in the applications plugin

This commit is contained in:
Kirottu
2023-01-05 10:19:54 +02:00
parent 27ccf9c657
commit 3f349301bf

View File

@@ -37,6 +37,7 @@ pub fn get_matches(input: RString, entries: &mut Vec<(DesktopEntry, u64)>) -> RV
.filter_map(|(entry, id)| { .filter_map(|(entry, id)| {
matcher matcher
.fuzzy_match(&entry.name, &input) .fuzzy_match(&entry.name, &input)
.max(matcher.fuzzy_match(&entry.exec, &input))
.map(|val| (entry, id, val)) .map(|val| (entry, id, val))
}) })
.collect::<Vec<_>>(); .collect::<Vec<_>>();