aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-09-25 17:00:57 +0100
committerStephen Blott2016-09-25 17:00:57 +0100
commit6fafe8bc8057c90240b74b56d94707f4f1cd2968 (patch)
treede257ffce43e7ddccd30f7dd678b193e6262323a
parente7c64d80d04c57da09b63e99a4b63396f3a96fcd (diff)
downloadvimium-6fafe8bc8057c90240b74b56d94707f4f1cd2968.tar.bz2
Reinstate highlighting of first hint.
Applies to filtered hints only.
-rw-r--r--content_scripts/link_hints.coffee10
1 files changed, 5 insertions, 5 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee
index bc2dd5bc..adab0e9d 100644
--- a/content_scripts/link_hints.coffee
+++ b/content_scripts/link_hints.coffee
@@ -159,7 +159,7 @@ class LinkHintsMode
@stableSortCount = 0
@hintMarkers = (@createMarkerFor desc for desc in hintDescriptors)
@markerMatcher = new (if Settings.get "filterLinkHints" then FilterHints else AlphabetHints)
- @markerMatcher.fillInMarkers @hintMarkers
+ @markerMatcher.fillInMarkers @hintMarkers, @.getNextZIndex.bind this
@hintMode = new Mode
name: "hint/#{@mode.name}"
@@ -507,12 +507,12 @@ class FilterHints
marker.innerHTML = spanWrap(marker.hintString +
(if marker.showLinkText then ": " + linkText else ""))
- fillInMarkers: (hintMarkers) ->
+ fillInMarkers: (hintMarkers, getNextZIndex) ->
@renderMarker marker for marker in hintMarkers when marker.isLocalMarker
- # We use @filterLinkHints() here (although we know that all of the hints will match) to fill in the hint
- # strings. This ensures that we always get hint strings in the same order.
- @filterLinkHints hintMarkers
+ # We use @getMatchingHints() here (although we know that all of the hints will match) to get an order on
+ # the hints and highlight the first one.
+ @getMatchingHints hintMarkers, 0, getNextZIndex
getMatchingHints: (hintMarkers, tabCount, getNextZIndex) ->
# At this point, linkTextKeystrokeQueue and hintKeystrokeQueue have been updated to reflect the latest