aboutsummaryrefslogtreecommitdiffstats
path: root/background_scripts
diff options
context:
space:
mode:
authorStephen Blott2016-02-18 10:29:51 +0000
committerStephen Blott2016-02-18 10:29:51 +0000
commitf91fb7b9e11095cbb59174601096f0239501f6a0 (patch)
treed0ac44c1ee050c256e3e03de244a3b0efb50d02f /background_scripts
parent8e3ac1867b7577814865bf1cb40d0b865de30b1a (diff)
parent38509ce26afd1df7288255bfbcae1705f7bf9d86 (diff)
downloadvimium-f91fb7b9e11095cbb59174601096f0239501f6a0.tar.bz2
Merge pull request #1985 from smblott-github/pass-next-key
New command: Pass next key
Diffstat (limited to 'background_scripts')
-rw-r--r--background_scripts/commands.coffee12
1 files changed, 11 insertions, 1 deletions
diff --git a/background_scripts/commands.coffee b/background_scripts/commands.coffee
index db8cc60f..80ca0f96 100644
--- a/background_scripts/commands.coffee
+++ b/background_scripts/commands.coffee
@@ -67,6 +67,13 @@ Commands =
when "unmapAll"
@keyToCommandRegistry = {}
+ # Push the key mapping for passNextKey into Settings so that it's available in the front end for insert
+ # mode. We exclude single-key mappings (that is, printable keys) because when users press printable keys
+ # in insert mode they expect the character to be input, not to be droppped into some special Vimium
+ # mode.
+ Settings.set "passNextKeyKeys",
+ (key for own key of @keyToCommandRegistry when @keyToCommandRegistry[key].command == "passNextKey" and 1 < key.length)
+
clearKeyMappingsAndSetDefaults: ->
@keyToCommandRegistry = {}
@mapKeyToCommand { key, command } for own key, command of defaultKeyMappings
@@ -96,6 +103,7 @@ Commands =
"goUp",
"goToRoot",
"enterInsertMode",
+ "passNextKey",
"enterVisualMode",
"enterVisualLineMode",
"focusInput",
@@ -164,7 +172,8 @@ Commands =
"moveTabRight",
"closeTabsOnLeft",
"closeTabsOnRight",
- "closeOtherTabs"]
+ "closeOtherTabs",
+ "passNextKey"]
defaultKeyMappings =
"?": "showHelp"
@@ -277,6 +286,7 @@ commandDescriptions =
openCopiedUrlInNewTab: ["Open the clipboard's URL in a new tab", { background: true, repeatLimit: 20 }]
enterInsertMode: ["Enter insert mode", { noRepeat: true }]
+ passNextKey: ["Pass the next key to Chrome", { passCountToFunction: true }]
enterVisualMode: ["Enter visual mode", { noRepeat: true }]
enterVisualLineMode: ["Enter visual line mode", { noRepeat: true }]