From 1a9d1efc3dc81aa36fec0bf4af84fe9e0c0a2dde Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 18 Dec 2017 10:09:53 +0000 Subject: 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. --- content_scripts/link_hints.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content_scripts') 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... -- cgit v1.2.3