1
0
forked from aniani/vim

runtime(vim): Update base-syntax, improve Vim9 block start pattern

The opening curly brace must be followed by whitespace, comment or
trailing bar.

closes: #17454

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns 2025-06-05 20:23:07 +02:00 committed by Christian Brabandt
parent a2dd40c057
commit 1cccdebc0f
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
6 changed files with 65 additions and 39 deletions

View File

@ -2,7 +2,7 @@
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Jun 02
" Last Change: 2025 Jun 05
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
@ -674,7 +674,12 @@ endif
" Blocks: {{{2
" ======
Vim9 syn region vim9Block matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Vim9 syn region vim9Block
\ matchgroup=vimSep
\ start="{\ze\s*\%($\|[#|]\)"
\ end="^\s*\zs}"
\ skipwhite nextgroup=vim9Comment,vimCmdSep
\ contains=@vimDefBodyList
" Keymaps: {{{2
" =======

View File

@ -1,12 +1,14 @@
>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
@75
|#+0#0000e05&| |V|i|m|9| |b|l|o|c|k|s| +0#0000000&@61
|#+0#0000e05&| |V|I|M|_|T|E|S|T|S|E|T|U|P| |s|e|t| |l|i|s|t| |l|i|s|t|c|h|a|r|s|=|t|a|b|:|>| |,|t|r|a|i|l|:|-|,|e|x|t|e|n|d|s|:|>|,|p|r|e|c|e|d|e|s|:|<|,|n|b|s|p
|:|+| +0#0000000&@72
@75
@75
|{+0#e000e06&| +0#0000000&@73
@2|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@60
|}+0#e000e06&| +0#0000000&@73
@75
@75
|{+0#e000e06&| +0#0000000&@73
@2|{+0#e000e06&| +0#0000000&@71
@4|{+0#e000e06&| +0#0000000&@69
@ -15,6 +17,4 @@
@6|}+0#e000e06&| +0#0000000&@67
@6|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@56
@4|}+0#e000e06&| +0#0000000&@69
@4|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@58
@2|}+0#e000e06&| +0#0000000&@71
@57|1|,|1| @10|T|o|p|

View File

@ -1,12 +1,15 @@
| +0&#ffffff0@7|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@54
| +0&#ffffff0@3|{+0#e000e06&| +0#0000000&@69
@6|{+0#e000e06&| +0#0000000&@67
@8|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@54
@6|}+0#e000e06&| +0#0000000&@67
@6|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@56
@4|}+0#e000e06&| +0#0000000&@69
@4>}+0#e000e06&| +0#0000000&@69
@4|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@58
@2>}+0#e000e06&| +0#0000000&@71
@2|}+0#e000e06&| +0#0000000&@71
@2|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@60
|}+0#e000e06&| +0#0000000&@73
@75
@75
|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|)| +0#0000000&@65
@2|{+0#e000e06&| +0#0000000&@71
@4|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@58
@ -14,7 +17,4 @@
@2|}+0#e000e06&| +0#0000000&@71
|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
@75
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|f|o@1|"| +0#0000000&||| |{+0#e000e06&| +0#0000000&@60
@2|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@60
|}+0#e000e06&| +0#0000000&@73
@57|1|9|,|3| @9|9|2|%|
@57|1|8|,|5| @9|4|0|%|

View File

@ -1,20 +1,20 @@
|}+0#e000e06#ffffff0| +0#0000000&@73
> @74
|~+0#4040ff13&| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
|~| @73
| +0#0000000&@56|3@1|,|0|-|1| @7|B|o|t|
| +0&#ffffff0@74
@75
|#+0#0000e05&| |s|t|a|r|t|/|e|n|d| |p|a|t@1|e|r|n|s| +0#0000000&@54
@75
|{+0#e000e06&| +0#0000000&@73
@2>v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@60
|}+0#e000e06&| +0#0000000&@73
@75
|{+0#e000e06&| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
@2|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@60
|}+0#e000e06&| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63
@75
|e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&||| |{+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|r|"| +0#0000000&@47
@2|v+0#af5f00255&|a|r| +0#0000000&|f+0#00e0e07&|o@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|4+0#e000002&|2| +0#0000000&@60
|}+0#e000e06&| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|B|a|z|"| +0#0000000&@60
@75
|#+0#0000e05&| |d|i|c|t|i|o|n|a|r|y| +0#0000000&@62
|{+0#e000e06&|}|-+0#af5f00255&|>|i+0#00e0e07&|t|e|m|s|(+0#e000e06&|)| +0#0000000&@63
@75
@57|3|6|,|3| @9|B|o|t|

View File

@ -1,17 +1,18 @@
vim9script
# Vim9 blocks
# VIM_TESTSETUP set list listchars=tab:> ,trail:-,extends:>,precedes:<,nbsp:+
{
var foo = 42
}
{
{
{
{
var foo = 42
var foo = 42
}
var foo = 42
}
@ -20,6 +21,7 @@ vim9script
var foo = 42
}
def Foo()
{
var foo = 42
@ -27,7 +29,21 @@ def Foo()
}
enddef
echo "foo" | {
var foo = 42
}
# start/end patterns
{
var foo = 42
}
{ # comment
var foo = 42
} # comment
echo "Foo" | { | echo "Bar"
var foo = 42
} | echo "Baz"
# dictionary
{}->items()

View File

@ -2,7 +2,7 @@
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <dougkearns@gmail.com>
" Last Change: 2025 Jun 02
" Last Change: 2025 Jun 05
" Former Maintainer: Charles E. Campbell
" DO NOT CHANGE DIRECTLY.
@ -727,7 +727,12 @@ endif
" Blocks: {{{2
" ======
Vim9 syn region vim9Block matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList
Vim9 syn region vim9Block
\ matchgroup=vimSep
\ start="{\ze\s*\%($\|[#|]\)"
\ end="^\s*\zs}"
\ skipwhite nextgroup=vim9Comment,vimCmdSep
\ contains=@vimDefBodyList
" Keymaps: {{{2
" =======