From 921429924c6b212f7d2a5d7cd15975f243cb2ed6 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sat, 24 Sep 2016 10:17:43 +0100 Subject: 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. --- content_scripts/mode_key_handler.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'content_scripts') 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() -- cgit v1.2.3