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

make :execute eval its arg

This commit is contained in:
Doug Kearns
2008-08-21 22:28:03 +00:00
parent b08d4630e5
commit 37a2aa50fb

View File

@@ -219,7 +219,21 @@ const liberator = (function () //{{{
liberator.commands.add(["exe[cute]"],
"Execute the argument as an Ex command",
function (args) { liberator.execute(args); });
// FIXME: this should evaluate each arg separately then join
// with " " before executing.
function (args)
{
try
{
var cmd = eval("with (liberator) {" + args + "}");
liberator.execute(cmd);
}
catch (e)
{
liberator.echoerr(e);
return;
}
});
liberator.commands.add(["exu[sage]"],
"List all Ex commands with a short description",