1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 15:48:00 +01:00

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.
This commit is contained in:
Ted Pavlic
2009-01-16 15:33:43 -05:00
parent 22d3bc470b
commit ba948246cc
2 changed files with 3 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ function Editor() //{{{
"Abbreviate a key sequence" + modeDescription, "Abbreviate a key sequence" + modeDescription,
function (args) function (args)
{ {
let matches = args.string.match(/^([^\s"']*)\s*(.*)/); let matches = args.string.match(/^\s*([^\s"']*)(?:\s*$|\s+(.*))/);
if (! matches) if (! matches)
{ {
liberator.echoerr("E474: Invalid argument"); liberator.echoerr("E474: Invalid argument");

View File

@@ -179,7 +179,8 @@ section:Abbreviations[abbreviations]
________________________________________________________________________________ ________________________________________________________________________________
Abbreviate a key sequence. Abbreviate {lhs} to {rhs}. If only {lhs} is given, 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 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.
________________________________________________________________________________ ________________________________________________________________________________