aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/commands.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-02-21 07:32:20 +0000
committerStephen Blott2016-02-21 07:32:20 +0000
commit1de41f55c121192556a7bf182211fb3b6deeccc8 (patch)
tree06ebf1fe4590e1bbb8cd09330b3582d16c9ee859 /background_scripts/commands.coffee
parent972bf7a5e47f6f4abd9db5024914a87f0dad9084 (diff)
downloadvimium-1de41f55c121192556a7bf182211fb3b6deeccc8.tar.bz2
Include count command option in repeat limit.
We need to multiply by `count=N` *before* checking `repeatLimit`. Tweaks #2001.
Diffstat (limited to 'background_scripts/commands.coffee')
-rw-r--r--background_scripts/commands.coffee5
1 files changed, 3 insertions, 2 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index b4c503c1..74c2d08b 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -84,8 +84,9 @@ Commands =
options[parse[0]] = if parse.length == 1 then true else parse[1]
# We parse any `count` option immediately (to avoid having to parse it repeatedly later).
- if "count" of options and not @availableCommands[command].noRepeat
- options.count = if /^[1-9]/.test options.count then parseInt options.count else 1
+ if "count" of options
+ options.count = parseInt options.count
+ delete options.count if isNaN(options.count) or @availableCommands[command].noRepeat
options