diff options
| author | Stephen Blott | 2015-06-09 10:55:59 +0100 |
|---|---|---|
| committer | Stephen Blott | 2015-06-09 10:55:59 +0100 |
| commit | 054bda0d1d3c5131361fc62aeca4b40ece9f233b (patch) | |
| tree | 6b8e2042034ad390ddd108570a7a0d9fcc5f869d | |
| parent | e422af43a075f52d0f2f4bf69243a699b99ba33b (diff) | |
| download | vimium-054bda0d1d3c5131361fc62aeca4b40ece9f233b.tar.bz2 | |
Tweak comments re. keydown versus keypress.
| -rw-r--r-- | content_scripts/link_hints.coffee | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 02d61f3c..ca104dd6 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -391,10 +391,11 @@ class AlphabetHints constructor: -> @linkHintCharacters = Settings.get "linkHintCharacters" - # We use the keyChar from keydown if the link-hint characters are all "a-z". This is the default, and - # preserves the legacy behavior (which always used keydown) for users which are familiar with that - # behavior. Otherwise, we use keyChar from keypress, which admits non-Latin characters. See #1722. - @useKeydown = /^[a-z]*$/.test @linkHintCharacters + # We use the keyChar from keydown if the link-hint characters are all "a-z0-9". This is the default + # settings value, and preserves the legacy behavior (which always used keydown) for users which are + # familiar with that behavior. Otherwise, we use keyChar from keypress, which admits non-Latin + # characters. See #1722. + @useKeydown = /^[a-z0-9]*$/.test @linkHintCharacters @activateOnEnter = false @hintKeystrokeQueue = [] @@ -537,6 +538,9 @@ class FilterHints { linksMatched: linksMatched, delay: delay } pushKeyChar: (keyChar, keydownKeyChar) -> + # For filtered hints, we *always* use the keyChar value from keypress, because there is no obvious and + # easy-to-understand meaning for choosing one of keyChar or keydownKeyChar (as there is for alphabet + # hints). if 0 <= @linkHintNumbers.indexOf keyChar @hintKeystrokeQueue.push keyChar else |
