aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-01-28 16:37:41 +0000
committerStephen Blott2016-01-28 16:37:41 +0000
commit75463367b337bd600e9c8a9e4d56ca06da341527 (patch)
tree99e082e2b46260491d6c71bf95ffe0ced0ddfe8f
parentb586d9dea17496bcedee37320841020592db35bd (diff)
downloadvimium-75463367b337bd600e9c8a9e4d56ca06da341527.tar.bz2
Simplify hint-string generation; tweaks.
-rw-r--r--content_scripts/link_hints.coffee9
1 files changed, 2 insertions, 7 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index 68cbb915..4ced15f6 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -440,11 +440,6 @@ class AlphabetHints
# may be of different lengths.
#
hintStrings: (linkCount) ->
- return [] if linkCount == 0
-
- # In the following:
- # - at no point is any hint in hints a prefix of any other hint
- # - the shorter hints are always at the start of the list
hints = [""]
offset = 0
while hints.length - offset < linkCount or hints.length == 1
@@ -453,9 +448,9 @@ class AlphabetHints
hints = hints[offset...offset+linkCount]
# This shuffles the hints so that they're scattered; hints starting with the same character are spread
- # evenly throughout the array. We reverse each hint, then sort them then reverse again.
+ # evenly throughout the array. We reverse each hint, then sort them, then reverse them again.
hints = (hint.split("").reverse().join "" for hint in hints).sort()
- return (hint.split("").reverse().join "" for hint in hints[...linkCount])
+ return (hint.split("").reverse().join "" for hint in hints)
getMatchingHints: (hintMarkers) ->
matchString = @hintKeystrokeQueue.join ""