aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/Settings.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/Settings.qml')
-rw-r--r--desktop/Settings.qml11
1 files changed, 6 insertions, 5 deletions
diff --git a/desktop/Settings.qml b/desktop/Settings.qml
index 607d6a3..e73445c 100644
--- a/desktop/Settings.qml
+++ b/desktop/Settings.qml
@@ -54,16 +54,17 @@ Scope {
const q = root.query.trim().toLowerCase();
const out = [];
for (const m of root.pages) {
+ // ponytail: the first perPage rows per page; a narrower query finds the rest.
+ const rows = q === "" ? [] : m.searchItems.filter(it => it.text.toLowerCase().includes(q)).slice(0, root.perPage);
if (q === "" || m.label.toLowerCase().includes(q) || m.name.includes(q))
out.push({ mod: m, hit: "", key: "" });
- else {
+ else if (rows.length === 0) {
+ // A keyword that a row also matches would only repeat that
+ // row as a hit that opens at the top, so it shows alone.
const k = Array.from(m.keywords).find(w => w.toLowerCase().includes(q));
if (k !== undefined) out.push({ mod: m, hit: k, key: "" });
}
- if (q === "") continue;
- // ponytail: the first perPage rows per page; a narrower query finds the rest.
- for (const it of m.searchItems.filter(it => it.text.toLowerCase().includes(q)).slice(0, root.perPage))
- out.push({ mod: m, hit: it.text, key: it.key });
+ for (const it of rows) out.push({ mod: m, hit: it.text, key: it.key });
}
return out;
}