1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 17:32:25 +01:00

add rudimentary <q-args> support to :command

This commit is contained in:
Doug Kearns
2008-08-27 10:03:25 +00:00
parent 603d097733
commit f9a6d40697
2 changed files with 9 additions and 5 deletions

View File

@@ -679,7 +679,10 @@ liberator.Commands = function () //{{{
"User defined command",
function (args, special, count, modifiers)
{
var replaced = rep.replace("<args>", args).replace("<lt>", "<");
var replaced = rep.replace("<args>", args);
replaced = replaced.replace("<q-args>", '"' + args.replace('"', '\\"', "g") + '"');
replaced = replaced.replace("<lt>", "<");
liberator.execute(replaced);
},
{ replacementText: rep }, special))

View File

@@ -251,8 +251,9 @@ replaced with values from the user entered command line. The resulting string
is then executed as an Ex command.
The valid escape sequences are:
`--------`----------------------------------------------------------------------
`----------`--------------------------------------------------------------------
*<args>* The command arguments exactly as supplied
*<q-args>* The command arguments quoted as a single value in a manner suitable for expression evaluation
*<lt>* A literal '<' character to allow for a literal copy of one of the escape sequences. E.g. <lt>args> will expand to a literal <args>
--------------------------------------------------------------------------------