From 1de41f55c121192556a7bf182211fb3b6deeccc8 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 21 Feb 2016 07:32:20 +0000 Subject: Include count command option in repeat limit. We need to multiply by `count=N` *before* checking `repeatLimit`. Tweaks #2001. --- background_scripts/commands.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'background_scripts/commands.coffee') 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 -- cgit v1.2.3