diff options
| -rw-r--r-- | background_scripts/commands.coffee | 5 | ||||
| -rw-r--r-- | background_scripts/main.coffee | 3 |
2 files changed, 4 insertions, 4 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 diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 196cf11f..a4162fc7 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -470,6 +470,7 @@ checkKeyQueue = (keysToCheck, tabId, frameId) -> if (Commands.keyToCommandRegistry[command]) registryEntry = Commands.keyToCommandRegistry[command] runCommand = true + count *= registryEntry.options.count ? 1 if registryEntry.noRepeat count = 1 @@ -482,8 +483,6 @@ checkKeyQueue = (keysToCheck, tabId, frameId) -> """ if runCommand - # Account for any command-option "count". - count *= registryEntry.options.count ? 1 if not registryEntry.isBackgroundCommand chrome.tabs.sendMessage tabId, name: "executePageCommand" |
