aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2017-12-18 10:09:53 +0000
committerStephen Blott2017-12-18 10:09:55 +0000
commit1a9d1efc3dc81aa36fec0bf4af84fe9e0c0a2dde (patch)
treec2b0f19b90105690d536095cad44dd0fba9fe5da
parentb6a0bd0cf29fc3621f4c337616ed119f239c0ed0 (diff)
downloadvimium-1a9d1efc3dc81aa36fec0bf4af84fe9e0c0a2dde.tar.bz2
Tweak hint scoring for filtered hints.
This tweaks the scoring of hints for filtered hints. Specifically, it scores matches at the start of the text or the start of a word higher than whole-word matches. This is intended avoid the phenomenon whereby adding matching characters to the filter causes the selected hint to change.
-rw-r--r--content_scripts/link_hints.coffee4
1 files changed, 2 insertions, 2 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 7cd2dfbf..ba9ada38 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -571,9 +571,9 @@ class FilterHints
if position < 0
0 # No match.
else if position == 0 and searchWord.length == linkWord.length
- if idx == 0 then 8 else 6 # Whole-word match.
+ if idx == 0 then 8 else 4 # Whole-word match.
else if position == 0
- if idx == 0 then 4 else 2 # Match at the start of a word.
+ if idx == 0 then 6 else 2 # Match at the start of a word.
else
1 # 0 < position; other match.
Math.max linkWordScores...