diff options
| -rw-r--r-- | background_scripts/completion.coffee | 2 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index 9e12d497..e959d358 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -171,7 +171,7 @@ class DomainCompleter for domain in domainCandidates recencyScore = RankingUtils.recencyScore(@domains[domain].lastVisitTime || 0) wordRelevancy = RankingUtils.wordRelevancy(queryTerms, domain, null) - score = wordRelevancy + Math.max(recencyScore, wordRelevancy) / 2 + score = (wordRelevancy + Math.max(recencyScore, wordRelevancy)) / 2 results.push([domain, score]) results.sort (a, b) -> b[1] - a[1] results diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index e2bfeb6d..3d3a59a6 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -192,8 +192,9 @@ handleSettings = (args, port) -> refreshCompleter = (request) -> completers[request.name].refresh() +whitespaceRegexp = /\s+/ filterCompleter = (args, port) -> - queryTerms = if (args.query == "") then [] else args.query.split(" ") + queryTerms = if (args.query == "") then [] else args.query.split(whitespaceRegexp) completers[args.name].filter(queryTerms, (results) -> port.postMessage({ id: args.id, results: results })) getCurrentTimeInSeconds = -> Math.floor((new Date()).getTime() / 1000) |
