mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-23 19:52:26 +01:00
add rudimentary <q-args> support to :command
This commit is contained in:
@@ -679,7 +679,10 @@ liberator.Commands = function () //{{{
|
|||||||
"User defined command",
|
"User defined command",
|
||||||
function (args, special, count, modifiers)
|
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);
|
liberator.execute(replaced);
|
||||||
},
|
},
|
||||||
{ replacementText: rep }, special))
|
{ replacementText: rep }, special))
|
||||||
|
|||||||
@@ -251,9 +251,10 @@ replaced with values from the user entered command line. The resulting string
|
|||||||
is then executed as an Ex command.
|
is then executed as an Ex command.
|
||||||
|
|
||||||
The valid escape sequences are:
|
The valid escape sequences are:
|
||||||
`--------`----------------------------------------------------------------------
|
`----------`--------------------------------------------------------------------
|
||||||
*<args>* The command arguments exactly as supplied
|
*<args>* The command arguments exactly as supplied
|
||||||
*<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>
|
*<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>
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Note: {attr} not implemented yet.
|
Note: {attr} not implemented yet.
|
||||||
|
|||||||
Reference in New Issue
Block a user