aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/link_hints.coffee
diff options
context:
space:
mode:
authorStephen Blott2015-06-10 14:43:00 +0100
committerStephen Blott2015-06-10 14:43:08 +0100
commitddc747805e08eaad52bf58950b1d2df9bdd2da9c (patch)
tree8a86a1199a2f4124e63d6001f079536168234ec4 /content_scripts/link_hints.coffee
parent5aaed906b94337bb2136d74672e16679ab457c49 (diff)
downloadvimium-ddc747805e08eaad52bf58950b1d2df9bdd2da9c.tar.bz2
Account for words at start of filter text.
We gove these a higher score because it makes it easier for the user to pick a link if they can just start typing at the beginning.
Diffstat (limited to 'content_scripts/link_hints.coffee')
-rw-r--r--content_scripts/link_hints.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index ae9d3f8f..3dbb4f23 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -586,11 +586,11 @@ class FilterHints
searchWordScores =
for searchWord in searchWords
linkWordScores =
- for linkWord in linkWords
+ for linkWord, idx in linkWords
if linkWord == searchWord
- 5
+ if idx == 0 then 8 else 6
else if linkWord.startsWith searchWord
- 2
+ if idx == 0 then 4 else 2
else if 0 <= linkWord.indexOf searchWord
1
else