diff options
| -rw-r--r-- | commands.js | 13 | ||||
| -rw-r--r-- | options.html | 1 |
2 files changed, 10 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 = {}; + } } } diff --git a/options.html b/options.html index 68f3ad7b..4cf5853c 100644 --- a/options.html +++ b/options.html @@ -224,6 +224,7 @@ <div style="margin-left:10px;margin-top:5px"> map j scrollDown<br/> unmap j<br/> + unmapAll<br/> " this is a comment<br/> # this is also a comment<br/> </div> |
