0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

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 :function 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
@@ -174,6 +175,18 @@ function Foo()
endfunction
" command modifiers
silent! function Foo()
endfunction
" leading command separator
echo "Foo" | function Foo()
endfunction
" delete function
delfunction Foo
@@ -220,3 +233,45 @@ endfunction
:function Foo()
:endfunction
" Issue #15671
" No recognition of :fun or :def bodies commencing with empty lines if
" g:vimsyn_folding contains "f"
fun FA1()
return
endfun
fun FA2()
return
endfun
fun FB1() abort
return
endfun
fun FB2() abort
return
endfun
fun FC1(_)
return
endfun
fun FC2(_)
return
endfun
fun FD1(_) abort
return
endfun
fun FD2(_) abort
return
endfun