diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-07 16:56:10 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-05-07 16:56:10 +1000 |
| commit | 9b958a8e10f2271dd485bacd867f4627eb1b66b1 (patch) | |
| tree | ec46f07ba515b2770900024804f0ca31a1032085 /modules | |
| parent | osd: partially revert last commit (diff) | |
| download | caelestia-shell-9b958a8e10f2271dd485bacd867f4627eb1b66b1.tar.gz caelestia-shell-9b958a8e10f2271dd485bacd867f4627eb1b66b1.tar.bz2 caelestia-shell-9b958a8e10f2271dd485bacd867f4627eb1b66b1.zip | |
launcher: better fuzzy query
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/launcher/Actions.qml | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/launcher/Actions.qml b/modules/launcher/Actions.qml index 4323bff..e604ae3 100644 --- a/modules/launcher/Actions.qml +++ b/modules/launcher/Actions.qml @@ -88,15 +88,17 @@ Singleton { } ] - readonly property list<var> preppedNames: list.map(a => ({ + readonly property list<var> preppedActions: list.map(a => ({ name: Fuzzy.prepare(a.name), + desc: Fuzzy.prepare(a.desc), action: a })) function fuzzyQuery(search: string): var { - return Fuzzy.go(search.slice(LauncherConfig.actionPrefix.length), preppedNames, { + return Fuzzy.go(search.slice(LauncherConfig.actionPrefix.length), preppedActions, { all: true, - key: "name" + keys: ["name", "desc"], + scoreFn: r => r[0].score * 0.9 + r[1].score * 0.1 }).map(r => r.obj.action); } |