patch 8.2.3268: cannot use a block with :autocmd like with :command
Problem: Cannot use a block with :autocmd like with :command.
Solution: Add support for a {} block after :autocmd. (closes #8620)
diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt
index 7614e8b..d3ebc11 100644
--- a/runtime/doc/autocmd.txt
+++ b/runtime/doc/autocmd.txt
@@ -76,6 +76,12 @@
script. Thus this depends on where the autocmd is defined, not where it is
triggered.
+{cmd} can use a block, like with `:command`, see |:command-repl|. Example: >
+ au BufReadPost *.xml {
+ setlocal matchpairs+=<:>
+ /<start
+ }
+
Note: The ":autocmd" command can only be followed by another command when the
'|' appears before {cmd}. This works: >
:augroup mine | au! BufRead | augroup END
diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt
index 505f815..a10c85b 100644
--- a/runtime/doc/map.txt
+++ b/runtime/doc/map.txt
@@ -1,4 +1,4 @@
-*map.txt* For Vim version 8.2. Last change: 2021 Jul 28
+*map.txt* For Vim version 8.2. Last change: 2021 Aug 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1571,7 +1571,7 @@
Replacement text ~
-
+ *:command-repl*
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.
@@ -1580,8 +1580,8 @@
echo 'hello'
g:calledMyCommand = true
}
-No nesting is supported. Using `:normal` directly does not work, you can use
-it indirectly with `:execute`.
+No nesting is supported, inline functions cannot be used. Using `:normal`
+directly does not work, you can use it indirectly with `:execute`.
The replacement text {repl} for a user defined command is scanned for special
escape sequences, using <...> notation. Escape sequences are replaced with