diff options
| author | mrmr1993 | 2017-11-16 17:34:18 +0000 | 
|---|---|---|
| committer | mrmr1993 | 2017-11-16 17:34:18 +0000 | 
| commit | 3735cffca60ce86a473df1a9fb5f959addb6ec18 (patch) | |
| tree | ad9cf45214df9a71d365d297c9167944b071b057 | |
| parent | 1880062f68e6f4280b7257f3cd437c0aee7c9696 (diff) | |
| download | vimium-3735cffca60ce86a473df1a9fb5f959addb6ec18.tar.bz2 | |
Use Mode::push to handle adding/removing a handler
| -rw-r--r-- | content_scripts/link_hints.coffee | 6 | 
1 files changed, 1 insertions, 5 deletions
| diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index f2fb7c19..1e4670dd 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -249,17 +249,13 @@ class LinkHintsMode            when "Control"              @setOpenLinkMode(if @mode is OPEN_IN_NEW_FG_TAB then OPEN_IN_NEW_BG_TAB else OPEN_IN_NEW_FG_TAB) -        handlerId = handlerStack.push +        handlerId = @hintMode.push            keyup: (event) =>              if event.key == key                handlerStack.remove()                @setOpenLinkMode previousMode              true # Continue bubbling the event. -        # For some (unknown) reason, we don't always receive the keyup event needed to remove this handler. -        # Therefore, we ensure that it's always removed when hint mode exits.  See #1911 and #1926. -        @hintMode.onExit -> handlerStack.remove handlerId -      else if KeyboardUtils.isBackspace event        if @markerMatcher.popKeyChar()          @updateVisibleMarkers() | 
