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)
This commit is contained in:
@ -76,6 +76,12 @@ and in a `:def` function) then {cmd} will be executed as in Vim9
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user