patch 8.2.3228: cannot use a simple block for the :command argument

Problem:    Cannot use a simple block for the :command argument. (Maarten
            Tournoij)
Solution:   Recognize a simple {} block. (issue #8623)
This commit is contained in:
Bram Moolenaar
2021-07-27 21:17:32 +02:00
parent 53ba05b090
commit 5d7c2df536
6 changed files with 84 additions and 14 deletions

View File

@ -1572,6 +1572,16 @@ feature. Use the full name for new scripts.
Replacement text ~
The {repl} argument is normally one long string, possibly with "|" separated
commands. A special case is when the argument is "{", then the following
lines, up to a line starting with "}" are used and |Vim9| syntax applies.
Example: >
:command MyCommand {
echo 'hello'
g:calledMyCommand = true
}
No nesting is supported.
The replacement text {repl} for a user defined command is scanned for special
escape sequences, using <...> notation. Escape sequences are replaced with
values from the entered command line, and all other text is copied unchanged.