Skip to content

Commit b21edf8

Browse files
committed
plugins/applications: Fix incorrect action detection logic
1 parent 591a1a4 commit b21edf8

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

plugins/applications/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub fn get_matches(input: RString, state: &State) -> RVec<Match> {
204204
let mut score = (app_score * 25 + keyword_score) - entry.offset;
205205

206206
// prioritize actions
207-
if entry.desc.is_some() {
207+
if entry.is_action {
208208
score *= 2;
209209
}
210210

plugins/applications/src/scrubber.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ pub struct DesktopEntry {
1414
pub icon: String,
1515
pub term: bool,
1616
pub offset: i64,
17+
pub is_action: bool,
1718
}
1819

1920
const FIELD_CODE_LIST: &[&str] = &[
@@ -126,6 +127,7 @@ impl DesktopEntry {
126127
.map(|val| val.to_lowercase() == "true")
127128
.unwrap_or(false),
128129
offset: 0,
130+
is_action: false,
129131
})
130132
} else {
131133
None
@@ -195,6 +197,7 @@ impl DesktopEntry {
195197
.map(|val| val.to_lowercase() == "true")
196198
.unwrap_or(false),
197199
offset: i as i64,
200+
is_action: true,
198201
})
199202
}
200203
}

0 commit comments

Comments
 (0)