diff options
| author | ilya | 2010-02-26 22:51:09 -0800 |
|---|---|---|
| committer | ilya | 2010-02-26 22:51:36 -0800 |
| commit | f14d93799552436c1ea0f4706ef4f012f522b885 (patch) | |
| tree | 98632ff0c6bcfebd7572b9d0c9e05eda437610f1 /commands.js | |
| parent | f4a0f8b79678fd8d67f1ccb140f838df04a7313a (diff) | |
| download | vimium-f14d93799552436c1ea0f4706ef4f012f522b885.tar.bz2 | |
Key Mapping - Add support for comments in the mappings text.
Diffstat (limited to 'commands.js')
| -rw-r--r-- | commands.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/commands.js b/commands.js index d7c8b12a..77277c73 100644 --- a/commands.js +++ b/commands.js @@ -27,16 +27,17 @@ function parseCustomKeyMappings(customKeyMappings) { lines = customKeyMappings.split("\n"); for (var i = 0; i < lines.length; i++) { - line = lines[i].split(" "); // TODO(ilya): Support all whitespace. - if (line.length < 2) { continue } + 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 = line[0]; - var key = line[1]; + var lineCommand = split_line[0]; + var key = split_line[1]; if (lineCommand == "map") { - if (line.length != 3) { continue } + if (split_line.length != 3) { continue } - var vimiumCommand = line[2]; + var vimiumCommand = split_line[2]; if (!availableCommands[vimiumCommand]) { continue } |
