aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-09-24 10:17:43 +0100
committerStephen Blott2016-09-24 10:17:43 +0100
commit921429924c6b212f7d2a5d7cd15975f243cb2ed6 (patch)
treec69ae207a489fd95f3c7a26cdc39677cd0260e3f
parentfc8ed2ae1b237b83974b7408b6a174a3af3ab9cc (diff)
downloadvimium-921429924c6b212f7d2a5d7cd15975f243cb2ed6.tar.bz2
Fix key handling for 3-key mappings.
This only affects key mappings of three keys or longer. Consider: map goa something map gob something Previously, we launched the vomnibar (`o`) on the after `go`, making these mappings unusable. This commit fixes that: `go` no longer launches the Vomnibar, but waits instead to see what the next key is.
-rw-r--r--content_scripts/mode_key_handler.coffee4
1 files changed, 2 insertions, 2 deletions
diff --git a/content_scripts/mode_key_handler.coffee b/content_scripts/mode_key_handler.coffee
index 0b8145fc..6b6e4f0a 100644
--- a/content_scripts/mode_key_handler.coffee
+++ b/content_scripts/mode_key_handler.coffee
@@ -96,8 +96,8 @@ class KeyHandlerMode extends Mode
@countPrefix = 0 unless keyChar of @keyState[0]
# Advance the key state. The new key state is the current mappings of keyChar, plus @keyMapping.
@keyState = [(mapping[keyChar] for mapping in @keyState when keyChar of mapping)..., @keyMapping]
- command = (mapping for mapping in @keyState when "command" of mapping)[0]
- if command
+ if @keyState[0].command?
+ command = @keyState[0]
count = if 0 < @countPrefix then @countPrefix else 1
bgLog "Call #{command.command}[#{count}] (#{@name})"
@reset()