mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 08:57:58 +01:00
Change :abbr to parse its args.string itself.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user