1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 22:52:38 +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)
{
let [lhs, rhs] = args;
if (rhs)
if (lhs.match(/\W/))
{
if (lhs.match(/\W/))
{
liberator.echoerr("E474: Invalid argument");
return false;
}
editor.addAbbreviation(mode, lhs, rhs);
liberator.echoerr("E474: Invalid argument");
return false;
}
if (rhs)
editor.addAbbreviation(mode, lhs, rhs);
else
editor.listAbbreviations(mode, lhs || "");
},