runtime(vim): Update base syntax, fix :map termination in :command RHS

Ensure :map (and :abbreviate) terminate at | when included in :command
replacement strings containing commands separated by line continuations.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
This commit is contained in:
Doug Kearns
2025-07-29 21:03:52 +10:00
committed by dkearns
parent 0fde6aebdd
commit b88f9e4a04
26 changed files with 275 additions and 136 deletions

View File

@ -1,21 +1,24 @@
" Vim :abbreviate commands
" VIM_TEST_SETUP hi link vimMapLhs Identifier
" VIM_TEST_SETUP hi link vimMapRhs Todo
" VIM_TEST_SETUP hi link vimMapRhsContinue Todo
abbrev <buffer> foo foobar
cabbrev <buffer> cfoo cfoobar
iabbrev <buffer> ifoo cfoobar
iabbrev <buffer> ifoo ifoobar
abbrev <expr> <buffer> foo foobar
cabbrev <expr> <buffer> cfoo cfoobar
iabbrev <expr> <buffer> ifoo cfoobar
iabbrev <expr> <buffer> ifoo ifoobar
noreabbrev <buffer> foo foobar
cnoreabbrev <buffer> cfoo cfoobar
inoreabbrev <buffer> ifoo cfoobar
inoreabbrev <buffer> ifoo ifoobar
abbrev <expr> <buffer> foo foobar
cabbrev <expr> <buffer> cfoo cfoobar
iabbrev <expr> <buffer> ifoo cfoobar
iabbrev <expr> <buffer> ifoo ifoobar
unabbrev <buffer> foo
cunabbrev <buffer> cfoo
@ -25,3 +28,27 @@ abclear <buffer>
cabclear <buffer>
iabclear <buffer>
" Multiline RHS
abbrev foo
\ foobar
abbrev foo
\
\ foobar
abbrev foo
"\ comment
\ foobar
abbrev foo
"\ comment
\ foo
"\ comment
\bar
abbrev lhs
"\ comment (matches as RHS but harmless)
echo "clear"

View File

@ -161,3 +161,10 @@ command -range=% -nargs=? -bang Tb {
command -range=% -nargs=? -bang Tb :<line1>,<line2>s/\v"[^"]*"/\=substitute(submatch(0), " ", "•", "g")/ge
" Unreported issue (:map with trailing bar in replacement text)
command! Foo
\ map lhs rhs |
\ abbreviate foo bar |
\ echo "Foo"

View File

@ -1,4 +1,7 @@
" Vim :map commands
" VIM_TEST_SETUP hi link vimMapLhs Identifier
" VIM_TEST_SETUP hi link vimMapRhs Todo
" VIM_TEST_SETUP hi link vimMapRhsContinue Todo
map!