runtime(vim): Update base-syntax, match escape sequences in :command blocks

- Match escape sequences in :command replacement blocks.
- Match :substitute after escape sequences (a temporary fix until Ex
  commands are contained).

fixes: #17326
closes: #17663

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-07-05 15:21:03 +02:00
committed by Christian Brabandt
parent f9d87fa6ba
commit a8b86605f3
12 changed files with 62 additions and 23 deletions

View File

@ -142,3 +142,22 @@ com Foo call system('ls')
command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ <args>
" Issue #17326 (syntax highlighting breaks with complex :s comamnd)
command -range=% -nargs=? -bang Tb {
if "<bang>" == "!"
:<line1>,<line2>s/\v"[^"]*"/\=substitute(submatch(0), " ", "•", "g")/ge
endif
if "<args>" == ""
:<line1>,<line2>!column -t
else
:<line1>,<line2>!column -t -s'<args>'
endif
if "<bang>" == "!"
:<line1>,<line2>s/•/ /ge
endif
}
command -range=% -nargs=? -bang Tb :<line1>,<line2>s/\v"[^"]*"/\=substitute(submatch(0), " ", "•", "g")/ge