From 18d8c9043f8651a94885831c799e3fda7a8b1dc0 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 6 Mar 2016 11:13:51 +0000 Subject: Fix count handling (again). `7gj` should be `1j`. Also, with: map ab SOMETHING `7aab` should be `1ab`. Replacement for 7774beb6643c0d905f9caba4345453790af948ad. --- content_scripts/mode_key_handler.coffee | 2 ++ 1 file changed, 2 insertions(+) (limited to 'content_scripts') 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] -- cgit v1.2.3