From efb80f9b1cc60f0acdc733a2d42227eb566f909a Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sun, 26 Jul 2015 22:15:53 +0100 Subject: Only apply passkeys to single character keys explicitly Before this change, a string in KeyboardUtils.keyNames could have the key it represents disabled if * its letters were in alphabetical order, and * the user has set all of its letters as passkeys, with none in between. For example, imagining that "del" (for delete) was in KeyboardUtils.keyNames, the passkeys "dpyl0e" would cause the delete key to be a passkey too. This commit fixes the issue by only applying passkeys when keyChar is a single character. --- content_scripts/mode_passkeys.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content_scripts/mode_passkeys.coffee b/content_scripts/mode_passkeys.coffee index 1ed69ac2..631eb621 100644 --- a/content_scripts/mode_passkeys.coffee +++ b/content_scripts/mode_passkeys.coffee @@ -12,7 +12,7 @@ class PassKeysMode extends Mode # passKey, then 'gt' and '99t' will neverthless be handled by Vimium. handleKeyChar: (event, keyChar) -> return @continueBubbling if event.altKey or event.ctrlKey or event.metaKey - if keyChar and not @keyQueue and 0 <= @passKeys.indexOf keyChar + if keyChar and not @keyQueue and keyChar.length == 1 and 0 <= @passKeys.indexOf keyChar @stopBubblingAndTrue else @continueBubbling -- cgit v1.2.3