aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/commands.coffee
diff options
context:
space:
mode:
authorStephen Blott2016-02-21 06:44:07 +0000
committerStephen Blott2016-02-21 06:47:06 +0000
commit636964735bc8e9f1b802dc392b628e5ff92d319f (patch)
treeabd77343fe48d647ac45ca7b7b0d9da052693ca0 /background_scripts/commands.coffee
parent46c4700a16a6fc07ede085eca73c26046418245b (diff)
downloadvimium-636964735bc8e9f1b802dc392b628e5ff92d319f.tar.bz2
Rework count command option initialisation.
Previously: map J scrollDown count=NotANumber would break the command completely. Fixes an error introduced in #2001.
Diffstat (limited to 'background_scripts/commands.coffee')
-rw-r--r--background_scripts/commands.coffee5
1 files changed, 2 insertions, 3 deletions
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