aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-03-06 11:13:51 +0000
committerStephen Blott2016-03-06 11:13:51 +0000
commit18d8c9043f8651a94885831c799e3fda7a8b1dc0 (patch)
treee5179ae9e6dd1fe190aff5a04a8cc7c9016a36ed /content_scripts
parent88224d8ee99eac49a57f7137b5f056e151c6a426 (diff)
downloadvimium-18d8c9043f8651a94885831c799e3fda7a8b1dc0.tar.bz2
Fix count handling (again).
`7gj` should be `1j`. Also, with: map ab SOMETHING `7aab` should be `1ab`. Replacement for 7774beb6643c0d905f9caba4345453790af948ad.
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/mode_key_handler.coffee2
1 files changed, 2 insertions, 0 deletions
diff --git a/content_scripts/mode_key_handler.coffee b/content_scripts/mode_key_handler.coffee
index 586f9193..d06bddb5 100644
--- a/content_scripts/mode_key_handler.coffee
+++ b/content_scripts/mode_key_handler.coffee
@@ -89,6 +89,8 @@ class KeyHandlerMode extends Mode
handleKeyChar: (keyChar) ->
bgLog "Handling key #{keyChar}, mode=#{@name}."
+ # A count prefix applies only so long a keyChar is mapped in @keyState[0]; e.g. 7gj should be 1j.
+ @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]