Skip to content

Commit ec5bf35

Browse files
tobiabocchiTobia Bocchi
andauthored
Switch to quick-score for fuzzy search (leftover) (#2370)
* Switch to quick-score for fuzzy search * Sort dependencies * Sort dependencies, again --------- Co-authored-by: Tobia Bocchi <tobiabocchi@serendipity.local>
1 parent 0cbc52f commit ec5bf35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

js/searchbar/customBangs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const { ipcRenderer } = require('electron')
44
const fs = require('fs')
5+
const quickScore = require('quick-score').quickScore
56

67
const bangsPlugin = require('searchbar/bangsPlugin.js')
78

@@ -84,7 +85,7 @@ function searchAndSortTasks (text) {
8485
const task = t.task
8586
const taskName = (task.name ? task.name : l('defaultTaskName').replace('%n', tasks.getIndex(task.id) + 1)).toLowerCase()
8687
const exactMatch = taskName.indexOf(searchText) !== -1
87-
const fuzzyTitleScore = taskName.score(searchText, 0.5)
88+
const fuzzyTitleScore = quickScore(taskName, searchText)
8889

8990
return (exactMatch || fuzzyTitleScore > 0.4)
9091
})

0 commit comments

Comments
 (0)