diff options
| author | Stephen Blott | 2015-01-06 12:43:22 +0000 |
|---|---|---|
| committer | Stephen Blott | 2015-01-06 12:43:22 +0000 |
| commit | ff88d1707647253cb3b93d3dc79831dc72063feb (patch) | |
| tree | b72355f7aa740e67e34b69529d9a588eb64e57be | |
| parent | 849f1caeeabefbbc0233c9ebc69c41146fe01898 (diff) | |
| download | vimium-ff88d1707647253cb3b93d3dc79831dc72063feb.tar.bz2 | |
Modes; fix non-vimium keys in PostFindMode.
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 10 |
1 files changed, 8 insertions, 2 deletions
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 |
