aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-03-26 11:23:51 +0000
committerStephen Blott2016-03-26 11:23:53 +0000
commitaa8f568c6c3be795c17c3b5107a8a8c70fc6e930 (patch)
tree4549f2402e0d8e6db28addd711eb6f15ed3c687c
parent5073fc3005b0cab3b44062d051311a704882d4d5 (diff)
downloadvimium-aa8f568c6c3be795c17c3b5107a8a8c70fc6e930.tar.bz2
Fix inappropriate variable name.
"description" is the first element here, not all elements. So "descriptor" is a better name.
-rw-r--r--background_scripts/commands.coffee7
1 files changed, 3 insertions, 4 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 6c452242..b58a3b0c 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -1,7 +1,7 @@
Commands =
init: ->
- for own command, description of commandDescriptions
- @addCommand(command, description[0], description[1])
+ for own command, descriptor of commandDescriptions
+ @addCommand(command, descriptor[0], descriptor[1])
@loadKeyMappings Settings.get "keyMappings"
Settings.postUpdateHooks["keyMappings"] = @loadKeyMappings.bind this
@@ -18,12 +18,11 @@ Commands =
# - background: whether this command needs to be run against the background page.
# - passCountToFunction: true if this command should have any digits which were typed prior to the
# command passed to it. This is used to implement e.g. "closing of 3 tabs".
- addCommand: (command, description, options) ->
+ addCommand: (command, description, options = {}) ->
if command of @availableCommands
BgUtils.log "#{command} is already defined! Check commands.coffee for duplicates."
return
- options ||= {}
@availableCommands[command] = extend options, description: description
mapKeyToCommand: ({ key, command, options }) ->