0
0
mirror of https://github.com/vim/vim.git synced 2025-10-16 07:24:23 -04:00

runtime(vim): Update base syntax, contain user command replacement text

Ensure that :command replacement text terminates at the end of the
logical line.

Add :command to the generator exclusion list.

fixes: #18414 (@Dougaak)
fixes: #18448 (Maxim Kim)
closes: #18415

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-10-01 21:03:22 +00:00
committed by Christian Brabandt
parent a644b7924d
commit 0977c8b03e
15 changed files with 79 additions and 30 deletions

View File

@@ -1,7 +1,7 @@
" Vim syntax file generator
" Language: Vim script
" Maintainer: Hirohito Higashi (h_east)
" Last Change: 2025 Sep 23
" Last Change: 2025 Sep 27
let s:keepcpo= &cpo
set cpo&vim
@@ -307,6 +307,7 @@ function s:get_vim_command_type(cmd_name)
catch
chdir
class
command
copy
debuggreedy
def

View File

@@ -863,6 +863,7 @@ syn region vimUserCmdReplacement contained
\ skip=+\n\s*\%(\\\|["#]\\ \)+
\ end="$"
\ contains=@vimContinue,@vimUserCmdList,vimComFilter
\ keepend
syn region vimUserCmdBlock contained
\ matchgroup=vimSep
\ start="{"

View File

@@ -17,4 +17,4 @@
@6|\+0#e000e06&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@56
@75
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|a|d@1|r|=|a+0#00e0003&|r|g|u|m|e|n|t|s| +0#0000000&|-+0#e000e06&|b|a|n|g| +0#0000000&|-+0#e000e06&|b|a|r| +0#0000000&|-+0#e000e06&|b|u|f@1|e|r| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|a+0#00e0003&|r|g|l|i|s|t| +0#0000000&|-+0#e000e06&|c|o|u|n|t|=|1+0#e000002&| +0#0000000&|-+0#e000e06&|@+0#4040ff13&@2
| +0#0000000&@56|1|9|,|1| @10|8|%|
| +0#0000000&@56|1|9|,|1| @10|7|%|

View File

@@ -17,4 +17,4 @@
@75
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|c+0#00e0003&|u|s|t|o|m|,+0#0000000&|s+0#00e0e07&|:|C|o|m|p|l|e|t|e|r|1| +0#0000000&|F+0#0000001#ffff4012|o@1| +0#0000000#ffffff0|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@21
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|c+0#00e0003&|u|s|t|o|m|l|i|s|t|,+0#0000000&|s+0#00e0e07&|:|C|o|m|p|l|e|t|e|r|2| +0#0000000&|F+0#0000001#ffff4012|o@1| +0#0000000#ffffff0|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@17
@57|3|4|,|1| @9|1|8|%|
@57|3|4|,|1| @9|1|6|%|

View File

@@ -17,4 +17,4 @@
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|b|u|f@1|e|r| +0#0000000&@59
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|b+0#00e0003&|u|f@1|e|r| +0#0000000&@50
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|c|o|u|n|t| +0#0000000&@60
@57|5|0|,|0|-|1| @7|2|9|%|
@57|5|0|,|0|-|1| @7|2|4|%|

View File

@@ -17,4 +17,4 @@
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|*+0#00e0003&| +0#0000000&@58
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|r|a|n|g|e| +0#0000000&@60
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|r|e|g|i|s|t|e|r| +0#0000000&@57
@57|6|8|,|7| @9|4|1|%|
@57|6|8|,|7| @9|3|5|%|

View File

@@ -17,4 +17,4 @@
@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
@6|\+0#e000e06&| +0#0000000&|-+0#e000e06&|c|o|u|n|t| +0#0000000&@60
@6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58
@57|8|6|,|0|-|1| @7|5|2|%|
@57|8|6|,|0|-|1| @7|4|5|%|

View File

@@ -17,4 +17,4 @@
|"+0#0000e05&| |E|r@1|o|r|s| +0#0000000&@66
@75
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#ffffff16#ff404010|b|a|d|a|t@1|r|=+0#0000000#ffffff0|a|r|g|u|m|e|n|t|s| |-+0#e000e06&|b|a|n|g| +0#0000000&|-+0#ffffff16#ff404010|b|a|d|a|t@1|r| +0#0000000#ffffff0|-+0#e000e06&|n|a|r|g|s|=|*+0#00e0003&| +0#0000000&|F+0#0000001#ffff4012|o@1| +0#0000000#ffffff0|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@8
@57|1|0|4|,|7| @8|6|4|%|
@57|1|0|4|,|7| @8|5@1|%|

View File

@@ -17,4 +17,4 @@
|c+0#af5f00255&|o|m|c|l|e|a|r| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@53
@75
@75
@57|1|2@1|,|1| @8|7|6|%|
@57|1|2@1|,|1| @8|6|5|%|

View File

@@ -17,4 +17,4 @@
|"|•|"|,| |"|g|"|)|/+0#e000e06&|g|e| +0#0000000&@62
@4|e+0#af5f00255&|n|d|i|f| +0#0000000&@65
@4|i+0#af5f00255&|f| +0#0000000&|"+0#e000002&|<|a|r|g|s|>|"| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|"+0#e000002&@1| +0#0000000&@53
@57|1|4|0|,|0|-|1| @6|8@1|%|
@57|1|4|0|,|0|-|1| @6|7|5|%|

View File

@@ -13,8 +13,8 @@
@75
@75
|"+0#0000e05&| |U|n|r|e|p|o|r|t|e|d| |i|s@1|u|e| |(|:|m|a|p| |w|i|t|h| |t|r|a|i|l|i|n|g| |b|a|r| |i|n| |r|e|p|l|a|c|e|m|e|n|t| |t|e|x|t|)| +0#0000000&@11
@75
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|F+0#0000001#ffff4012|o@1| +0#0000000#ffffff0@62
@6|\+0#e000e06&| +0#0000000&|m+0#af5f00255&|a|p| +0#0000000&|l|h|s| |r|h|s| ||| @53
@6|\+0#e000e06&| +0#0000000&|a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&|f|o@1| |b|a|r| ||| @46
@6|\+0#e000e06&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@56
@57|1|5|7|,|5| @8|9@1|%|
@57|1|5|7|,|5| @8|8|4|%|

View File

@@ -1,20 +1,20 @@
| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@56
| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|a+0#af5f00255&|b@1|r|e|v|i|a|t|e| +0#0000000&|f|o@1| |b|a|r| ||| @46
@6|\+0#e000e06&| +0#0000000&|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@56
@75
@75
|"+0#0000e05&| |I|s@1|u|e| |#|1|8|4|1|4| |(|S|y|n|t|a|x| |g|r|o|u|p| |v|i|m|U|s|e|r|C|m|d|R|e|p|l|a|c|e|m|e|n|t| |l|a|c|k|i|n|g| |a| |k|e@1|p|e|n|d|?|)| +0#0000000&@4
> @74
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|7|0|,|0|-|1| @6|B|o|t|
|d+0#af5f00255&|e|f| +0#0000000&|V|i|m|9|C|o|n|t|e|x|t|(+0#e000e06&|)| +0#0000000&@57
@2|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|M+0#0000001#ffff4012|y|F|u|n|c|t|i|o|n| +0#0000000#ffffff0|M|y|F|u|n|c|(+0#e000e06&|)| +0#0000000&@44
@2|#+0#0000e05&| |I| |a|m| |a| |c|o|m@1|e|n|t| +0#0000000&@56
@75
@2|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|T+0#0000001#ffff4012|o|g@1|l|e|W|r|a|p| +0#0000000#ffffff0|s+0#af5f00255&|e|t|l|o|c|a|l| +0#0000000&|w+0#e000e06&|r|a|p|!| +0#0000000&@38
@2|#+0#0000e05&| |I| |a|m| |a| |c|o|m@1|e|n|t| |b|u|t| |I| |d|i|d|n|'|t| |g|e|t| |h|i|g|h|l|i|g|h|t|e|d| +0#0000000&@27
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
@75
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|M+0#0000001#ffff4012|y|F|u|n|c|t|i|o|n| +0#0000000#ffffff0|c+0#af5f00255&|a|l@1| +0#0000000&|M|y|F|u|n|c|(+0#e000e06&|)| +0#0000000&@41
|"+0#0000e05&| |I| |a|m| |a| |c|o|m@1|e|n|t| +0#0000000&@58
@75
|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|T+0#0000001#ffff4012|o|g@1|l|e|W|r|a|p| +0#0000000#ffffff0|s+0#af5f00255&|e|t|l|o|c|a|l| +0#0000000&|w+0#e000e06&|r|a|p|!| +0#0000000&@40
|"+0#0000e05&| |I| |a|m| |a| |c|o|m@1|e|n|t| |b|u|t| |I| |d|i|d|n|'|t| |g|e|t| |h|i|g|h|l|i|g|h|t|e|d| +0#0000000&@29
@57|1|7|4|,|0|-|1| @6|9|4|%|

View File

@@ -0,0 +1,20 @@
|"+0#0000e05#ffffff0| |I| |a|m| |a| |c|o|m@1|e|n|t| |b|u|t| |I| |d|i|d|n|'|t| |g|e|t| |h|i|g|h|l|i|g|h|t|e|d| +0#0000000&@29
@75
@75
|"+0#0000e05&| |I|s@1|u|e| |#|1|8|4@1|8| |(|c|o|m@1|e|n|t| |f|o|r| |s|u|b|s|e|q|u|e|n|t| |c|o|m@1|a|n|d| |i|s| |n|o|t| |h|i|g|h|l|i|g|h|t|e|d|)| +0#0000000&@8
@75
>d+0#af5f00255&|e|f| +0#0000000&|V|i|m|9|C|o|n|t|e|x|t|(+0#e000e06&|)| +0#0000000&@57
@2|c+0#af5f00255&|o|m@1|a|n|d|!| +0#0000000&|-+0#e000e06&|n|a|r|g|s|=|1+0#00e0003&| +0#0000000&|-+0#e000e06&|c|o|m|p|l|e|t|e|=|f+0#00e0003&|i|l|e| +0#0000000&|R+0#0000001#ffff4012|g| +0#0000000#ffffff0|:|t+0#af5f00255&|e|r|m| +0#0000000&|r|g| |<|a|r|g|s|>| @21
@2|#+0#0000e05&| |c|o|m@1|a|n|d|!| |-|n|a|r|g|s|=|1| |-|c|o|m|p|l|e|t|e|=|f|i|l|e| |R|g| |:|t|e|r|m| |+@1|s|h|e|l@1| |r|g| |<|a|r|g|s|>| +0#0000000&@11
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
@75
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|1|9|2|,|1| @8|B|o|t|

View File

@@ -163,8 +163,34 @@ command -range=% -nargs=? -bang Tb :<line1>,<line2>s/\v"[^"]*"/\=substitute(subm
" Unreported issue (:map with trailing bar in replacement text)
command! Foo
\ map lhs rhs |
\ abbreviate foo bar |
\ echo "Foo"
" Issue #18414 (Syntax group vimUserCmdReplacement lacking a keepend?)
def Vim9Context()
command! MyFunction MyFunc()
# I am a comment
command! ToggleWrap setlocal wrap!
# I am a comment but I didn't get highlighted
enddef
command! MyFunction call MyFunc()
" I am a comment
command! ToggleWrap setlocal wrap!
" I am a comment but I didn't get highlighted
" Issue #18448 (comment for subsequent command is not highlighted)
def Vim9Context()
command! -nargs=1 -complete=file Rg :term rg <args>
# command! -nargs=1 -complete=file Rg :term ++shell rg <args>
enddef

View File

@@ -919,6 +919,7 @@ syn region vimUserCmdReplacement contained
\ skip=+\n\s*\%(\\\|["#]\\ \)+
\ end="$"
\ contains=@vimContinue,@vimUserCmdList,vimComFilter
\ keepend
syn region vimUserCmdBlock contained
\ matchgroup=vimSep
\ start="{"