1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-04-18 17:53:32 +02: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"); liberator.echoerr("E474: Invalid argument");
return false; return false;
} }
if (rhs)
editor.addAbbreviation(mode, lhs, rhs); editor.addAbbreviation(mode, lhs, rhs);
}
else else
editor.listAbbreviations(mode, lhs || ""); editor.listAbbreviations(mode, lhs || "");
}, },