1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 15:18:00 +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, "Abbreviate a key sequence" + modeDescription,
function (args) function (args)
{ {
let [lhs, rhs] = args; let matches = args.string.match(/^([^\s"']*)\s*(.*)/);
if (lhs && lhs.match(/[\s"']/)) if (! matches)
{ {
liberator.echoerr("E474: Invalid argument"); liberator.echoerr("E474: Invalid argument");
return false; return false;
} }
let [,lhs,rhs] = matches;
if (rhs) if (rhs)
editor.addAbbreviation(mode, lhs, rhs); editor.addAbbreviation(mode, lhs, rhs);
else else