From ff88d1707647253cb3b93d3dc79831dc72063feb Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Tue, 6 Jan 2015 12:43:22 +0000 Subject: Modes; fix non-vimium keys in PostFindMode. --- content_scripts/vimium_frontend.coffee | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'content_scripts') diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 77738f59..07b430ba 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -460,7 +460,10 @@ onKeypress = (event) -> else if (!isInsertMode() && !findMode) if (isPassKey keyChar) return handlerStack.stopBubblingAndTrue - if (currentCompletionKeys.indexOf(keyChar) != -1 or isValidFirstKey(keyChar)) + if currentCompletionKeys.indexOf(keyChar) != -1 or isValidFirstKey(keyChar) or + # If PostFindMode is active, then we're blocking vimium's keystrokes from going into an input + # element. So we should also block other keystrokes (otherwise, it's weird). + InsertModeBlocker.isActive() DomUtils.suppressEvent(event) keyPort.postMessage({ keyChar:keyChar, frameId:frameId }) @@ -555,7 +558,10 @@ onKeydown = (event) -> # TOOD(ilya): Revisit this. Not sure it's the absolute best approach. if (keyChar == "" && !isInsertMode() && (currentCompletionKeys.indexOf(KeyboardUtils.getKeyChar(event)) != -1 || - isValidFirstKey(KeyboardUtils.getKeyChar(event)))) + isValidFirstKey(KeyboardUtils.getKeyChar(event)) || + # If PostFindMode is active, then we're blocking vimium's keystrokes from going into an input + # element. So we should also block other keystrokes (otherwise, it's weird). + InsertModeBlocker.isActive())) DomUtils.suppressPropagation(event) KeydownEvents.push event -- cgit v1.2.3