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

runtime(vim): Update base-syntax, fix inline Vim9 dict comments at SOL

Match Vim9 comments at start-of-line (no leading whitespace) in
dictionaries, lists and parenthesised expressions and argument lists.

Addresses https://github.com/vim/vim/pull/14975#issuecomment-2832643115

Report and fix by Aliaksei Budavei.

closes: #17211

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns 2025-04-27 19:17:06 +02:00 committed by Christian Brabandt
parent fa9753a721
commit b9ffbf57f8
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
8 changed files with 78 additions and 14 deletions

View File

@ -351,7 +351,7 @@ Vim9 syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%([#|]\|$\)" skipwhite nextgro
" Operators: {{{2
" =========
syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vimContinueString
syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString
syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString

View File

@ -17,4 +17,4 @@
@75
|#+0#0000e05&| |M|u|l|t|i|l|i|n|e| |c|o|m@1|e|n|t|s| +0#0000000&@54
@75
@57|1|9|,|0|-|1| @7|2|6|%|
@57|1|9|,|0|-|1| @7|1|7|%|

View File

@ -17,4 +17,4 @@
@75
|#+0#0000e05&| |L|i|n|e|-|c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t|s| +0#0000000&@46
@75
@57|3|7|,|1| @9|6|3|%|
@57|3|7|,|1| @9|4|2|%|

View File

@ -6,15 +6,15 @@
@6>\+0#e000e06&| +0#0000000&|a|r|g|2| @62
@75
@75
|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59
|#+0#0000e05&| |E|x|p|r|e|s@1|i|o|n| |c|o|m@1|e|n|t|s| +0#0000000&@53
@75
|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51
@2|c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#af5f00255&|n+0#0000000&|o|f|i|l|e| ||| |r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e+0#00e0e07&|d|i|t| +0#0000000&|%+0#af5f00255&@1| +0#0000000&||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&
@18|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33
|e+0#af5f00255&|n|d|i|f| +0#0000000&@69
|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|{+0#e000e06&| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@53
@2|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
@2|b+0#00e0e07&|a|r|:+0#0000000&| |4+0#e000002&|2|,+0#0000000&| |#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@54
@2|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
@2|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
@2|b+0#00e0e07&|a|z|:+0#0000000&| |4+0#e000002&|2| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@55
@2|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
|}+0#e000e06&| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
@75
@75
|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48
@75
|#+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45
@57|5@1|,|7| @9|B|o|t|
@57|5@1|,|7| @9|6|7|%|

View File

@ -0,0 +1,20 @@
| +0&#ffffff0@74
@75
|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1|3|0|4|7| +0#0000000&@59
@75
|i+0#af5f00255&|f| +0#0000000&|!+0#af5f00255&|e+0#00e0e07&|x|i|s|t|s|(+0#e000e06&|"+0#e000002&|:|D|i|f@1|O|r|i|g|"|)+0#e000e06&| +0#0000000&@51
@2>c+0#af5f00255&|o|m@1|a|n|d| +0#0000000&|D|i|f@1|O|r|i|g| |v+0#af5f00255&|e|r|t| +0#0000000&|n+0#af5f00255&|e|w| +0#0000000&||| |s+0#af5f00255&|e|t| +0#0000000&|b+0#e000e06&|t|=+0#af5f00255&|n+0#0000000&|o|f|i|l|e| ||| |r+0#af5f00255&| +0#0000000&|++0#af5f00255&@1|e+0#00e0e07&|d|i|t| +0#0000000&|%+0#af5f00255&@1| +0#0000000&||| |0+0#e000002&|d+0#0000000&|_| ||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&
@18|\+0#e000e06&| +0#0000000&||| |w+0#af5f00255&|i|n|c|m|d| +0#0000000&|p+0#af5f00255&| +0#0000000&||| |d+0#af5f00255&|i|f@1|t|h|i|s| +0#0000000&@33
|e+0#af5f00255&|n|d|i|f| +0#0000000&@69
@75
@75
|#+0#0000e05&| +0#0000000&|I+0#e000e06&|s@1|u|e|:| +0#0000e05&|#|1@1|3|0|7| |a|n|d| |#|1@1|5|6|0| +0#0000000&@48
@75
|#+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45
@75
@75
|#+0#0000e05&| +0#0000000&|P+0#e000e06&|R|:| +0#0000e05&|#|1|4|9|7|5| +0#0000000&@62
|#+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|p|u|l@1|/|1|4|9|7|5|#|i|s@1|u|e|c|o|m@1|e|n|t|-|2|8|3|2|6|4|3|1@1|5| +0#0000000&@11
@75
|v+0#af5f00255&|a|r| +0#0000000&|d+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|{+0#e000e06&| +0#0000000&@65
@57|7|3|,|3| @9|9|1|%|

View File

@ -0,0 +1,20 @@
|v+0#af5f00255#ffffff0|a|r| +0#0000000&|d+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|{+0#e000e06&| +0#0000000&@65
@4|a+0#00e0e07&|:| +0#0000000&|0+0#e000002&|,+0#0000000&| @65
|#+0#0000e05&| |a| |'| |q|u|o|t|e| |{@2| +0#0000000&@59
|#+0#0000e05&|}@2| +0#0000000&@70
|b+0#00e0e07&|:| +0#0000000&|0+0#e000002&|,+0#0000000&| @69
>}+0#e000e06&| +0#0000000&@73
@75
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|9|1|,|1| @9|B|o|t|

View File

@ -55,6 +55,18 @@ echo "TOP"
\ arg2
# Expression comments
var foo = { # comment
# comment
bar: 42, # comment
# comment
# comment
baz: 42 # comment
# comment
} # comment
# Issue: #13047
if !exists(":DiffOrig")
@ -66,3 +78,15 @@ endif
# Issue: #11307 and #11560
# This is what we call " blah
# PR: #14975
# https://github.com/vim/vim/pull/14975#issuecomment-2832643115
var d = {
a: 0,
# a ' quote {{{
#}}}
b: 0,
}

View File

@ -403,7 +403,7 @@ Vim9 syn match vimAugroup "\<aug\%[roup]\>\ze\s*\%([#|]\|$\)" skipwhite nextgro
" Operators: {{{2
" =========
syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vimContinueString
syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString
syn match vimOper "\a\@<!!" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
syn match vimOper "||\|&&\|[-+*/%.]" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile
syn match vimOper "?" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString