From ba948246cc11476e54fd2d238efb73e3a61e05de Mon Sep 17 00:00:00 2001 From: Ted Pavlic Date: Fri, 16 Jan 2009 15:33:43 -0500 Subject: [PATCH] Fix ":abbr this'is'a'test" to return an error, like Vim. Also note in map.txt that :abbr LHS cannot contain quotes or spaces. --- common/content/editor.js | 2 +- vimperator/locale/en-US/map.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/content/editor.js b/common/content/editor.js index 4dc0f8d1..a8f4c481 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -164,7 +164,7 @@ function Editor() //{{{ "Abbreviate a key sequence" + modeDescription, function (args) { - let matches = args.string.match(/^([^\s"']*)\s*(.*)/); + let matches = args.string.match(/^\s*([^\s"']*)(?:\s*$|\s+(.*))/); if (! matches) { liberator.echoerr("E474: Invalid argument"); diff --git a/vimperator/locale/en-US/map.txt b/vimperator/locale/en-US/map.txt index 152466bc..53fa2920 100644 --- a/vimperator/locale/en-US/map.txt +++ b/vimperator/locale/en-US/map.txt @@ -179,7 +179,8 @@ section:Abbreviations[abbreviations] ________________________________________________________________________________ Abbreviate a key sequence. Abbreviate {lhs} to {rhs}. If only {lhs} is given, list all abbreviations that start with {lhs}. List all abbreviations, if no -arguments are given. +arguments are given. To prevent ambiguity, the {lhs} cannot contain +quotes (' or ") or spaces. ________________________________________________________________________________