1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 11:07:58 +01:00

Change :abbr to parse its args.string itself.

This commit is contained in:
Ted Pavlic
2009-01-16 15:22:44 -05:00
parent a2c0233fc0
commit 22d3bc470b

View File

@@ -164,12 +164,13 @@ function Editor() //{{{
"Abbreviate a key sequence" + modeDescription,
function (args)
{
let [lhs, rhs] = args;
if (lhs && lhs.match(/[\s"']/))
let matches = args.string.match(/^([^\s"']*)\s*(.*)/);
if (! matches)
{
liberator.echoerr("E474: Invalid argument");
return false;
}
let [,lhs,rhs] = matches;
if (rhs)
editor.addAbbreviation(mode, lhs, rhs);
else