From f14d93799552436c1ea0f4706ef4f012f522b885 Mon Sep 17 00:00:00 2001 From: ilya Date: Fri, 26 Feb 2010 22:51:09 -0800 Subject: Key Mapping - Add support for comments in the mappings text. --- commands.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'commands.js') 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 } -- cgit v1.2.3