mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:17:59 +01:00
Make sure LHS of :abbr is is all word characters. E474 otherwise (mimic Vim).
This commit is contained in:
@@ -166,7 +166,15 @@ function Editor() //{{{
|
|||||||
{
|
{
|
||||||
let [lhs, rhs] = args;
|
let [lhs, rhs] = args;
|
||||||
if (rhs)
|
if (rhs)
|
||||||
|
{
|
||||||
|
if (lhs.match(/\W/))
|
||||||
|
{
|
||||||
|
liberator.echoerr("E474: Invalid argument");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
editor.addAbbreviation(mode, lhs, rhs);
|
editor.addAbbreviation(mode, lhs, rhs);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
editor.listAbbreviations(mode, lhs || "");
|
editor.listAbbreviations(mode, lhs || "");
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user