1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 08:07:59 +01:00

Make sure LHS of :abbr is is all word characters. E474 otherwise (mimic Vim).

This commit is contained in:
Ted Pavlic
2009-01-16 14:02:04 -05:00
parent 1019daa5ca
commit b758e2f729

View File

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