diff --git a/content/commands.js b/content/commands.js index e2454538..d701f756 100644 --- a/content/commands.js +++ b/content/commands.js @@ -679,7 +679,10 @@ liberator.Commands = function () //{{{ "User defined command", function (args, special, count, modifiers) { - var replaced = rep.replace("", args).replace("", "<"); + var replaced = rep.replace("", args); + replaced = replaced.replace("", '"' + args.replace('"', '\\"', "g") + '"'); + replaced = replaced.replace("", "<"); + liberator.execute(replaced); }, { replacementText: rep }, special)) @@ -735,7 +738,7 @@ liberator.Commands = function () //{{{ { var name = args.arguments[0]; var cmdlist = liberator.commands.getUserCommands(); - + for (var i = 0; i < cmdlist.length; i++) { if (cmdlist[i].name == name) diff --git a/locale/en-US/map.txt b/locale/en-US/map.txt index 612ccb97..82170aa5 100644 --- a/locale/en-US/map.txt +++ b/locale/en-US/map.txt @@ -251,9 +251,10 @@ replaced with values from the user entered command line. The resulting string is then executed as an Ex command. The valid escape sequences are: -`--------`---------------------------------------------------------------------- -** The command arguments exactly as supplied -** A literal '<' character to allow for a literal copy of one of the escape sequences. E.g. args> will expand to a literal +`----------`-------------------------------------------------------------------- +** The command arguments exactly as supplied +** The command arguments quoted as a single value in a manner suitable for expression evaluation +** A literal '<' character to allow for a literal copy of one of the escape sequences. E.g. args> will expand to a literal -------------------------------------------------------------------------------- Note: {attr} not implemented yet.