From 636964735bc8e9f1b802dc392b628e5ff92d319f Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 21 Feb 2016 06:44:07 +0000 Subject: Rework count command option initialisation. Previously: map J scrollDown count=NotANumber would break the command completely. Fixes an error introduced in #2001. --- background_scripts/commands.coffee | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'background_scripts/commands.coffee') diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index d247425a..684f726e 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -84,9 +84,8 @@ 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). - unless @availableCommands[command].noRepeat - if /^[1-9]/.test options.count - options.count = parseInt options.count + if "count" of options and not @availableCommands[command].noRepeat + options.count = if /^[1-9]/.test options.count then parseInt options.count else 1 options -- cgit v1.2.3