1
0
forked from aniani/vim

runtime(vim): Update base-syntax, improve folding function matches

- Allow function command modifiers.
- Match function bodies starting with empty lines.

Command modifiers reported by @Konfekt.

fixes #15671
closes: #15674

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2024-09-19 19:51:59 +02:00
committed by Christian Brabandt
parent e019f3626d
commit 35699f1749
48 changed files with 776 additions and 362 deletions

View File

@@ -1,5 +1,6 @@
" Vim :def command
" VIM_TEST_SETUP let g:vimsyn_folding = "f" | set fdm=syntax
" VIM_TEST_SETUP let g:vimsyn_folding = "f"
" VIM_TEST_SETUP setl fdc=2 fdl=999 fdm=syntax
" list
@@ -109,6 +110,18 @@ def Foo()
enddef
" command modifiers
silent! def Foo()
enddef
" leading command separator
echo "Foo" | def Foo()
enddef
" fold-region ending
def Foo()
@@ -128,3 +141,45 @@ enddef
:def Foo()
:enddef
" Issue #15671
" No recognition of :fun or :def bodies commencing with empty lines if
" g:vimsyn_folding contains "f"
def MA1()
return
enddef
def MA2()
return
enddef
def MB1(): void
return
enddef
def MB2(): void
return
enddef
def MC1(_: any)
return
enddef
def MC2(_: any)
return
enddef
def MD1(_: any): void
return
enddef
def MD2(_: any): void
return
enddef