1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-07 12:54:12 +01:00

Make some stuff nicer. Add heredoc support to :sty

This commit is contained in:
Kris Maglione
2008-10-04 00:00:25 +00:00
parent 267535d9c7
commit 40ff96452e
5 changed files with 27 additions and 41 deletions

View File

@@ -325,38 +325,19 @@ const liberator = (function () //{{{
}
else
{
// check for a heredoc
var matches = args.match(/(.*)<<\s*([^\s]+)$/);
if (matches && matches[2])
try
{
liberator.commandline.inputMultiline(new RegExp("^" + matches[2] + "$", "m"),
function (code)
{
try
{
eval(matches[1] + "\n" + code);
}
catch (e)
{
liberator.echoerr(e.name + ": " + e.message);
}
});
liberator.eval(args);
}
else // single line javascript code
catch (e)
{
try
{
liberator.eval(args);
}
catch (e)
{
liberator.echoerr(e.name + ": " + e.message);
}
liberator.echoerr(e.name + ": " + e.message);
}
}
},
{
completer: function (filter) liberator.completion.javascript(filter)
completer: function (filter) liberator.completion.javascript(filter),
hereDoc: true,
});
liberator.commands.add(["norm[al]"],