diff options
| author | Stephen Blott | 2016-10-02 16:09:55 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-10-02 16:09:55 +0100 |
| commit | 30387142cd1fee828f0dc39864c68960167deff1 (patch) | |
| tree | d040f1e9c746c20c23e11fd9ec612429c5291f6a | |
| parent | 3cabcc92adebabf7b5665fddc29c2fa3330ec000 (diff) | |
| download | vimium-30387142cd1fee828f0dc39864c68960167deff1.tar.bz2 | |
Tweak logging.
| -rw-r--r-- | background_scripts/commands.coffee | 6 | ||||
| -rw-r--r-- | content_scripts/mode_key_handler.coffee | 5 |
2 files changed, 6 insertions, 5 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 7ab09f24..531d491f 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -61,11 +61,13 @@ Commands = switch tokens[0] when "map" [ _, key, command, optionList... ] = tokens + keySequence = @parseKeySequence key if command? and @availableCommands[command] - keySequence = @parseKeySequence key key = keySequence.join "" - BgUtils.log "Mapping #{key} to #{command}" + BgUtils.log "mapping [\"#{keySequence.join '", "'}\"] to #{command}" @mapKeyToCommand { key, command, keySequence, options: @parseCommandOptions command, optionList } + else + BgUtils.log "skipping [\"#{keySequence.join '", "'}\"] for #{command} -- something is not right" when "unmap" if tokens.length == 2 diff --git a/content_scripts/mode_key_handler.coffee b/content_scripts/mode_key_handler.coffee index 6b6e4f0a..8c0ae4b8 100644 --- a/content_scripts/mode_key_handler.coffee +++ b/content_scripts/mode_key_handler.coffee @@ -20,7 +20,6 @@ class KeyHandlerMode extends Mode # Reset the key state, optionally retaining the count provided. reset: (@countPrefix = 0) -> - bgLog "Clearing key state: #{@countPrefix} (#{@name})" @keyState = [@keyMapping] constructor: (options) -> @@ -91,7 +90,7 @@ class KeyHandlerMode extends Mode @countPrefix == 0 and @keyState.length == 1 and keyChar in (@passKeys ? "") handleKeyChar: (keyChar) -> - bgLog "Handle key #{keyChar} (#{@name})" + bgLog "handle key #{keyChar} (#{@name})" # A count prefix applies only so long a keyChar is mapped in @keyState[0]; e.g. 7gj should be 1j. @countPrefix = 0 unless keyChar of @keyState[0] # Advance the key state. The new key state is the current mappings of keyChar, plus @keyMapping. @@ -99,7 +98,7 @@ class KeyHandlerMode extends Mode if @keyState[0].command? command = @keyState[0] count = if 0 < @countPrefix then @countPrefix else 1 - bgLog "Call #{command.command}[#{count}] (#{@name})" + bgLog " invoke #{command.command} count=#{count} " @reset() @commandHandler {command, count} @suppressEvent |
