aboutsummaryrefslogtreecommitdiffstats
path: root/commands.js
diff options
context:
space:
mode:
authorilya2010-04-18 19:41:08 -0700
committerilya2010-04-18 19:41:08 -0700
commit854d83fa974f17fe0f8066b65391ec770534a07a (patch)
treeeca6caa6800fc271d5170bef4f1a37d680644b60 /commands.js
parent70f2a92dcb9b0799db49305d4a47c0a104968847 (diff)
downloadvimium-854d83fa974f17fe0f8066b65391ec770534a07a.tar.bz2
Add an unmapAll command to the remapping interface. This closes #116.
Diffstat (limited to 'commands.js')
-rw-r--r--commands.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/commands.js b/commands.js
index 701947c2..0e5da3ef 100644
--- a/commands.js
+++ b/commands.js
@@ -29,14 +29,12 @@ function parseCustomKeyMappings(customKeyMappings) {
for (var i = 0; i < lines.length; i++) {
if (lines[i][0] == "\"" || lines[i][0] == "#") { continue }
split_line = lines[i].split(" "); // TODO(ilya): Support all whitespace.
- if (split_line.length < 2) { continue }
var lineCommand = split_line[0];
- var key = split_line[1];
if (lineCommand == "map") {
- if (split_line.length != 3) { continue }
-
+ if (split_line.length != 3) { continue; }
+ var key = split_line[1];
var vimiumCommand = split_line[2];
if (!availableCommands[vimiumCommand]) { continue }
@@ -45,9 +43,16 @@ function parseCustomKeyMappings(customKeyMappings) {
mapKeyToCommand(key, vimiumCommand);
}
else if (lineCommand == "unmap") {
+ if (split_line.length != 2) { continue; }
+
+ var key = split_line[1];
+
console.log("Unmapping", key);
unmapKey(key);
}
+ else if (lineCommand == "unmapAll") {
+ keyToCommandRegistry = {};
+ }
}
}