From 704303c108c1db3b318de4e272ac9af558985e51 Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Fri, 16 Jan 2009 14:19:17 -0500 Subject: [PATCH] Moved :abbr LHS non-word match to outside RHS check. Want to check LHS always (like Vim). --- common/content/editor.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index ca8fddc6..90a146cd 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -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 || ""); },