From b758e2f729918c7f77c6a41d3cb901ea14e03aff Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Fri, 16 Jan 2009 14:02:04 -0500 Subject: [PATCH] Make sure LHS of :abbr is is all word characters. E474 otherwise (mimic Vim). --- common/content/editor.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/content/editor.js b/common/content/editor.js index a7957355..ca8fddc6 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -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 || ""); },