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:
@@ -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");
|
||||||
|
|||||||
@@ -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.
|
||||||
________________________________________________________________________________
|
________________________________________________________________________________
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user