1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 17:12:28 +01:00

Moved :abbr LHS non-word match to outside RHS check. Want to check LHS always (like Vim).

This commit is contained in:
Ted Pavlic
2009-01-16 14:19:17 -05:00
parent b758e2f729
commit 704303c108

View File

@@ -165,16 +165,13 @@ function Editor() //{{{
function (args) function (args)
{ {
let [lhs, rhs] = args; let [lhs, rhs] = args;
if (rhs) if (lhs.match(/\W/))
{ {
if (lhs.match(/\W/)) liberator.echoerr("E474: Invalid argument");
{ return false;
liberator.echoerr("E474: Invalid argument");
return false;
}
editor.addAbbreviation(mode, lhs, rhs);
} }
if (rhs)
editor.addAbbreviation(mode, lhs, rhs);
else else
editor.listAbbreviations(mode, lhs || ""); editor.listAbbreviations(mode, lhs || "");
}, },