aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts/commands.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'background_scripts/commands.coffee')
-rw-r--r--background_scripts/commands.coffee11
1 files changed, 4 insertions, 7 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index 6f7b4334..a307f23f 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -13,7 +13,7 @@ Commands =
# command passed to it. This is used to implement e.g. "closing of 3 tabs".
addCommand: (command, description, options) ->
if command of @availableCommands
- console.log(command, "is already defined! Check commands.coffee for duplicates.")
+ logMessage? "#{command} is already defined! Check commands.coffee for duplicates."
return
options ||= {}
@@ -26,7 +26,7 @@ Commands =
mapKeyToCommand: ({ key, command, options }) ->
unless @availableCommands[command]
- console.log command, "doesn't exist!"
+ logMessage? "#{command} doesn't exist!"
return
options ?= []
@@ -55,13 +55,13 @@ Commands =
[ _, key, command, options... ] = tokens
if command? and @availableCommands[command]
key = @normalizeKey key
- console.log "Mapping", key, "to", command
+ logMessage? "Mapping #{key} to #{command}"
@mapKeyToCommand { key, command, options }
when "unmap"
if tokens.length == 2
key = @normalizeKey tokens[1]
- console.log "Unmapping", key
+ logMessage? "Unmapping #{key}"
delete @keyToCommandRegistry[key]
when "unmapAll"
@@ -98,7 +98,6 @@ Commands =
"enterInsertMode",
"enterVisualMode",
"enterVisualLineMode",
- # "enterEditMode",
"focusInput",
"LinkHints.activateMode",
"LinkHints.activateModeToOpenInNewTab",
@@ -187,7 +186,6 @@ defaultKeyMappings =
"i": "enterInsertMode"
"v": "enterVisualMode"
"V": "enterVisualLineMode"
- # "gv": "enterEditMode"
"H": "goBack"
"L": "goForward"
@@ -279,7 +277,6 @@ commandDescriptions =
enterInsertMode: ["Enter insert mode", { noRepeat: true }]
enterVisualMode: ["Enter visual mode", { noRepeat: true }]
enterVisualLineMode: ["Enter visual line mode", { noRepeat: true }]
- # enterEditMode: ["Enter vim-like edit mode (not yet implemented)", { noRepeat: true }]
focusInput: ["Focus the first text box on the page. Cycle between them using tab",
{ passCountToFunction: true }]