From 37a2aa50fbe10649dfe66eea0baf3be1de4335cf Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 21 Aug 2008 22:28:03 +0000 Subject: [PATCH] make :execute eval its arg --- content/liberator.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/content/liberator.js b/content/liberator.js index 495e90d1..57c29460 100644 --- a/content/liberator.js +++ b/content/liberator.js @@ -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",