diff options
| author | Stephen Blott | 2016-02-10 09:47:38 +0000 | 
|---|---|---|
| committer | Stephen Blott | 2016-02-18 07:34:30 +0000 | 
| commit | dcc5427b4b3c4a9440675c8443b31dc98fb62fdd (patch) | |
| tree | 7e5fb3a006810c60c89439ed93c2dd3f366a034c | |
| parent | daa357f1a753fd4c17427f68e0f0c3338e9d668b (diff) | |
| download | vimium-dcc5427b4b3c4a9440675c8443b31dc98fb62fdd.tar.bz2 | |
PassNextKey; store key mapping in settings.
We need the key mapped to passNextKey in the front end so that we can
activate pass-next-key from within insert mode too (without the need to
consult the background page).
| -rw-r--r-- | background_scripts/commands.coffee | 11 | ||||
| -rw-r--r-- | lib/settings.coffee | 1 | 
2 files changed, 12 insertions, 0 deletions
| diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee index 07f3640a..b9a2ef72 100644 --- a/background_scripts/commands.coffee +++ b/background_scripts/commands.coffee @@ -67,6 +67,17 @@ Commands =            when "unmapAll"              @keyToCommandRegistry = {} +    # Push the mapping for passNextKey into Settings so that it's available in the front end for insert mode. +    passNextKeyKey = null +    for own key of @keyToCommandRegistry +      if @keyToCommandRegistry[key].command == "passNextKey" +        passNextKeyKey = key +        break +    if passNextKeyKey +      Settings.set "passNextKeyKey", passNextKeyKey +    else +      Settings.clear "passNextKeyKey" +    clearKeyMappingsAndSetDefaults: ->      @keyToCommandRegistry = {}      @mapKeyToCommand { key, command } for own key, command of defaultKeyMappings diff --git a/lib/settings.coffee b/lib/settings.coffee index 31aad7ad..2e5ddcc0 100644 --- a/lib/settings.coffee +++ b/lib/settings.coffee @@ -174,6 +174,7 @@ Settings =      settingsVersion: Utils.getCurrentVersion()      helpDialog_showAdvancedCommands: false      optionsPage_showAdvancedOptions: false +    passNextKeyKey: ""  Settings.init() | 
