From 5d11b86ce60678558784039a7cf85c50dee5bf20 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Mon, 4 Apr 2016 06:44:12 +0100 Subject: Shorten link text. When a link's text is particularly long, displaying all of its text makes the hint look weird - so shorten it. We still use the full text for matching. --- content_scripts/link_hints.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'content_scripts') diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 92efcc7a..a91c45d4 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -421,8 +421,10 @@ class FilterHints hint.reverse().join "" renderMarker: (marker) -> + linkText = marker.linkText + linkText = "#{linkText[..32]}..." if 35 < linkText.length marker.innerHTML = spanWrap(marker.hintString + - (if marker.showLinkText then ": " + marker.linkText else "")) + (if marker.showLinkText then ": " + linkText else "")) fillInMarkers: (hintMarkers) -> @renderMarker marker for marker in hintMarkers when marker.isLocalMarker -- cgit v1.2.3