]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Update base-syntax, fix nested function folding (#14397)
authordkearns <dougkearns@gmail.com>
Sun, 14 Apr 2024 18:32:56 +0000 (04:32 +1000)
committerGitHub <noreply@github.com>
Sun, 14 Apr 2024 18:32:56 +0000 (20:32 +0200)
Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.

Fixes #14393

Signed-off-by: Christian Brabandt <cb@256bit.org>
Signed-off-by: Doug Kearns <dougkearns@gmail.com>
41 files changed:
runtime/syntax/generator/vim.vim.base
runtime/syntax/testdir/dumps/vim_ex_def_fold_01.dump
runtime/syntax/testdir/dumps/vim_ex_def_fold_02.dump
runtime/syntax/testdir/dumps/vim_ex_def_fold_03.dump
runtime/syntax/testdir/dumps/vim_ex_def_fold_04.dump
runtime/syntax/testdir/dumps/vim_ex_def_fold_05.dump
runtime/syntax/testdir/dumps/vim_ex_def_fold_06.dump
runtime/syntax/testdir/dumps/vim_ex_def_fold_07.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_def_fold_99.dump
runtime/syntax/testdir/dumps/vim_ex_def_nested_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_def_nested_99.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_99.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_fold_01.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_02.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_03.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_04.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_05.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_06.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_07.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_08.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_09.dump
runtime/syntax/testdir/dumps/vim_ex_function_fold_10.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_fold_11.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_fold_12.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_fold_99.dump
runtime/syntax/testdir/dumps/vim_ex_function_nested_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_nested_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_nested_99.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_99.dump [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_def_fold.vim
runtime/syntax/testdir/input/vim_ex_def_nested.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_def_nested_fold.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_function_fold.vim
runtime/syntax/testdir/input/vim_ex_function_nested.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim_ex_function_nested_fold.vim [new file with mode: 0644]
runtime/syntax/vim.vim

index f5e2110a29aafcff773cf453be08a26c331f26eb..90e1ee59bb2c2e3f5f663746284a3b3c00542917 100644 (file)
@@ -3,7 +3,7 @@
 " Maintainer:     Hirohito Higashi <h.east.727 ATMARK gmail.com>
 "         Doug Kearns <dougkearns@gmail.com>
 " URL:    https://github.com/vim-jp/syntax-vim-ex
-" Last Change:    2024 Apr 12
+" Last Change:    2024 Apr 13
 " Former Maintainer: Charles E. Campbell
 
 " DO NOT CHANGE DIRECTLY.
@@ -191,9 +191,9 @@ syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper,
 "   (buftype != nofile test avoids having append, change, insert show up in the command window)
 " =======================
 if &buftype != 'nofile'
- syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"          matchgroup=vimCommand end="^\.$""
- syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"          matchgroup=vimCommand end="^\.$""
- syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"          matchgroup=vimCommand end="^\.$""
+ syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"          matchgroup=vimCommand end="^\.$" extend
+ syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"          matchgroup=vimCommand end="^\.$" extend
+ syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"          matchgroup=vimCommand end="^\.$" extend
 endif
 
 " Behave! {{{2
@@ -244,12 +244,14 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
  syn match     vimOperError    ")"
 endif
 
-" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
+" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
 " =========
 syn cluster    vimFuncList     contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag
 syn cluster    vimDefList      contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag
-syn cluster    vimFuncBodyList contains=@vimCmdList,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimLetHereDoc,vimLineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst
-syn cluster    vimDefBodyList  contains=@vimCmdList,vimCmplxRepeat,vim9Comment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vim9LineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst
+
+syn cluster    vimFuncBodyCommon       contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold
+syn cluster    vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert
+syn cluster    vimDefBodyList  contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment
 
 syn region     vimFuncPattern  contained               matchgroup=vimOper start="/" end="$" contains=@vimSubstList
 syn match      vimFunction     "\<fu\%[nction]\>"      skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
@@ -284,9 +286,9 @@ syn match   vimEndfunction  "\<endf\%[unction]\>"
 syn match      vimEnddef       "\<enddef\>"
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
- syn region    vimFuncFold     start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*("        end="\<endf\%[unction]\>" contains=vimFunction fold keepend transparent
- syn region    vimFuncFold     start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+("               end="\<enddef\>"                contains=vimDef      fold keepend transparent
- syn region    vimFuncFold     start="\<def\s\+new\i\+("                               end="\<enddef\>"                contains=vimDef      fold keepend transparent
+ syn region    vimFuncFold     start="^\s*:\=\s*fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*("        end="^\s*:\=\s*endf\%[unction]\>" contains=vimFunction fold keepend extend transparent
+ syn region    vimFuncFold     start="^\s*:\=\s*def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+("               end="^\s*:\=\s*enddef\>"          contains=vimDef      fold keepend extend transparent
+ syn region    vimFuncFold     start="^\s*:\=\s*def\s\+new\i\+("                                       end="^\s*:\=\s*enddef\>"          contains=vimDef      fold keepend extend transparent
 endif
 
 syn match      vimFuncVar   contained  "a:\%(\K\k*\|\d\+\)\>"
@@ -502,7 +504,7 @@ syn keyword vimUnlet        unl[et]         skipwhite nextgroup=vimUnletBang,vimUnletVars
 syn match      vimUnletBang    contained       "!"     skipwhite nextgroup=vimUnletVars
 syn region     vimUnletVars    contained       start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
 
-VimFoldh syn region vimLetHereDoc      matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
+VimFoldh syn region vimLetHereDoc      matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' extend
 syn keyword    vimLet  var             skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
 
 " For: {{{2
index 4f80331b5cdbee4662842c102043a0fd9ac45d42..fa5ed9f5a4af07a47091f49efc9a18c07cb34f1f 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f|!| |F|o@1|(|)|:| |n|u|m|b|e|r|-@42
 | +0#0000000#ffffff0@74
-@57|1|9|,|1| @9|1|6|%| 
+@57|1|9|,|1| @9|1|2|%| 
index bbd362c83de9eb998ce8ea228452cc5fdbdfc3a7..2cfdcd4eae14ed39bd95514e8b80e504a2b7818c 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 |"+0#0000e05&| |s|a|m|e| |n|a|m|e| |a|s| |a|n| |E|x| |c|o|m@1|a|n|d| +0#0000000&@46
 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |s|:|l|s|(|)|-@50
-| +0#0000000#ffffff0@56|3|7|,|1| @9|3|4|%| 
+| +0#0000000#ffffff0@56|3|7|,|1| @9|2|7|%| 
index 7ba9744e8eb61e5f5e3f10e7131911a2ffa31ab7..667341512806a54b7ec6184c65241fd87e96c571 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|:| |l|i|s|t|<|d|i|c|t|<|n|u|m|b|e|r|>@1|-@31
 | +0#0000000#ffffff0@74
-@57|5@1|,|1| @9|5@1|%| 
+@57|5@1|,|1| @9|4@1|%| 
index 66c845b2ba46c77f9f30e299b02f3c37d5f38075..d2f047b06c37ce1ef96fafdf467b648beaebdf22 100644 (file)
@@ -17,4 +17,4 @@
 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
 | +0#0000000#ffffff0@74
 @75
-@57|7|3|,|1| @9|7@1|%| 
+@57|7|3|,|1| @9|6|2|%| 
index 688b788eb8d953d9cf1c08958c64defa98f95380..e2decdb0a323ecf259f08e03c09e394e39058729 100644 (file)
@@ -15,6 +15,6 @@
 @75
 |++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
 | +0#0000000#ffffff0@74
-|~+0#4040ff13&| @73
-|~| @73
-| +0#0000000&@56|9|1|,|0|-|1| @7|B|o|t
+@75
+|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54
+@57|9|1|,|0|-|1| @7|8|2|%
index c93c671669a3c22ec31dee7b548ce0a45417695a..2997eb863a49c3c7fdf227c0fc2c7d0caef723ba 100644 (file)
@@ -1,20 +1,20 @@
-| +0&#ffffff0@74
-|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
-| +0#0000000#ffffff0@74
-@75
-|"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62
-> @74
-|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|x|:| |b|o@1|l|,| |y| |=| |4|2|,| |z|:| |s|t|r|i|n|g| |=| |"|z|e|d|"|)|-@17
-| +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|-@52
 | +0#0000000#ffffff0@74
 @75
 |"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64
 @75
-|++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+>++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+@75
+|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54
+@75
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|d|e|f| |F|o@1|(|)|-@50
 | +0#0000000#ffffff0@74
 |~+0#4040ff13&| @73
-|~| @73
-|~| @73
-|~| @73
-| +0#0000000&@56|1|0|9|,|0|-|1| @6|B|o|t| 
+| +0#0000000&@56|1|0|9|,|1| @8|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_fold_07.dump b/runtime/syntax/testdir/dumps/vim_ex_def_fold_07.dump
new file mode 100644 (file)
index 0000000..b11b61e
--- /dev/null
@@ -0,0 +1,20 @@
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+> +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|d|e|f| |F|o@1|(|)|-@50
+| +0#0000000#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|2|7|,|0|-|1| @6|B|o|t| 
index f9e9ae099eab674b57b2a60c7eb320bfe80132ed..3020a24ad10fb00107ab7c595709943890933044 100644 (file)
@@ -1,20 +1,20 @@
 | +0&#ffffff0@74
-|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
-| +0#0000000#ffffff0@74
-|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
-| +0#0000000#ffffff0@74
-|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
-| +0#0000000#ffffff0@74
-@75
-|"+0#0000e05&| |p|a|r|a|m|e|t|e|r|s| +0#0000000&@62
-@75
-|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|x|:| |b|o@1|l|,| |y| |=| |4|2|,| |z|:| |s|t|r|i|n|g| |=| |"|z|e|d|"|)|-@17
-| +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|-@52
 | +0#0000000#ffffff0@74
 @75
 |"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64
 @75
 |++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+@75
+|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54
+@75
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |d|e|f| |F|o@1|(|)|-@51
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|d|e|f| |F|o@1|(|)|-@50
 > +0#0000000#ffffff0@74
-@57|1@1|0|,|0|-|1| @6|B|o|t| 
+@57|1|3|0|,|0|-|1| @6|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_00.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_00.dump
new file mode 100644 (file)
index 0000000..9f6d437
--- /dev/null
@@ -0,0 +1,20 @@
+>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
+|#+0#0000e05&| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@46
+@75
+|c+0#af5f00255&|l|a|s@1| +0#0000000&|T|e|s|t| @64
+@4|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @52
+@75
+@4|d+0#af5f00255&|e|f| +0#0000000&|n|e|w|(+0#e000e06&|)| +0#0000000&@61
+@8|d+0#af5f00255&|e|f| +0#0000000&|N|a|m|e|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@48
+@12|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@43
+@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|a|n|y|"| +0#0000000&@46
+@12|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@51
+@75
+@12|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@45
+@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60
+@75
+@8|t+0#af5f00255&|h|i|s|.|n+0#0000000&|a|m|e| |=+0#af5f00255&| +0#0000000&|N|a|m|e|(+0#e000e06&|)| +0#0000000&@48
+@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64
+|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66
+@75
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_99.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_99.dump
new file mode 100644 (file)
index 0000000..15c078a
--- /dev/null
@@ -0,0 +1,20 @@
+|#+0#0000e05#ffffff0| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@46
+@75
+|c+0#af5f00255&|l|a|s@1| +0#0000000&|T|e|s|t| @64
+@4|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @52
+@75
+@4|d+0#af5f00255&|e|f| +0#0000000&|n|e|w|(+0#e000e06&|)| +0#0000000&@61
+@8|d+0#af5f00255&|e|f| +0#0000000&|N|a|m|e|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@48
+@12|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@43
+@16|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|a|n|y|"| +0#0000000&@46
+@12|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@51
+@75
+@12|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|G|i|v|e|N|a|m|e|(+0#e000e06&|)| +0#0000000&@45
+@8|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@60
+@75
+@8|t+0#af5f00255&|h|i|s|.|n+0#0000000&|a|m|e| |=+0#af5f00255&| +0#0000000&|N|a|m|e|(+0#e000e06&|)| +0#0000000&@48
+@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64
+|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66
+@75
+>e+0#af5f00255&|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@59
+@57|2|0|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_00.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_00.dump
new file mode 100644 (file)
index 0000000..3bcaccc
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@62
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@44
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|c+0#af5f00255#ffffff0|l|a|s@1| +0#0000000&|T|e|s|t| @62
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @50
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| |1@1| |l|i|n|e|s|:| |d|e|f| |n|e|w|(|)|-@49
+| @1|e+0#af5f00255#ffffff0|n|d|c|l|a|s@1| +0#0000000&@64
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@57
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_01.dump
new file mode 100644 (file)
index 0000000..c1f9fa8
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|c+0#af5f00255#ffffff0|l|a|s@1| +0#0000000&|T|e|s|t| @62
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @50
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| >+|-@1| |1@1| |l|i|n|e|s|:| |d|e|f| |n|e|w|(|)|-@49
+| @1|e+0#af5f00255#ffffff0|n|d|c|l|a|s@1| +0#0000000&@64
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@57
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9|,|5|-|1| @7|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_99.dump b/runtime/syntax/testdir/dumps/vim_ex_def_nested_fold_99.dump
new file mode 100644 (file)
index 0000000..84a08f8
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@62
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|i|m|9| |:|d|e|f| |c|o|m@1|a|n|d| |(|n|e|s|t|e|d|)| +0#0000000&@44
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29
+| +0#0000e05#a8a8a8255@1|#+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|c+0#af5f00255#ffffff0|l|a|s@1| +0#0000000&|T|e|s|t| @62
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@3|c+0#af5f00255&|o|n|s|t| +0#0000000&|n+0#00e0e07&|a|m|e|:+0#0000000&| |s|t|r|i|n|g| @50
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| |1@1| |l|i|n|e|s|:| |d|e|f| |n|e|w|(|)|-@49
+| @1|e+0#af5f00255#ffffff0|n|d|c|l|a|s@1| +0#0000000&@64
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1>e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|T|e|s|t|.|n|e|w|(+0#e000e06&|)| +0#0000000&@57
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|2@1|,|1| @9|A|l@1| 
index 461531d1bef453f37a26a4387584123b8ec10f2e..9034e28a03f8178cfca291528e51bf17148dd8d3 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |{|"|F|"|}|{|"|o|"|}|{|"|o|"|}|(|)|-@34
 | +0#0000000#ffffff0@74
-@57|1|9|,|1| @10|8|%| 
+@57|1|9|,|1| @10|6|%| 
index 3a64c7f121625dca6d0a4b43a5a1717c8448f443..17e220f4a2e6c1f4589697f19af8b619462f2d97 100644 (file)
@@ -17,4 +17,4 @@
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |g|:|F|o@1|(|)|-@44
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |s|:|F|o@1|(|)|-@44
-| +0#0000000#ffffff0@56|3|7|,|1| @9|1|8|%| 
+| +0#0000000#ffffff0@56|3|7|,|1| @9|1|4|%| 
index 3f26306d7bd262b2110c507438220675378bfdd6..b229e6c9a383d3a64136bc0b52f3cb79a8201e0b 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 @75
 |"+0#0000e05&| |m|o|d|i|f|i|e|r|s| +0#0000000&@63
-@57|5@1|,|0|-|1| @7|2|8|%| 
+@57|5@1|,|0|-|1| @7|2@1|%| 
index 52423a2a263ea8635a8a4032874dafffdf138ed7..d9aa1c9f3f57666e5dc97e7e6cb62a33e71c66e1 100644 (file)
@@ -17,4 +17,4 @@
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)| |a|b|o|r|t|-@40
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)| |d|i|c|t|-@41
-| +0#0000000#ffffff0@56|7|3|,|1| @9|4|1|%| 
+| +0#0000000#ffffff0@56|7|3|,|1| @9|3|2|%| 
index d2acafc4635c11537b9f247c3fc342ac1e253ffa..989c504e8b8dd7385b58ca2209d2bd95536c3e29 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n|!| |F|o@1|(|)| |d|i|c|t|-@40
 | +0#0000000#ffffff0@74
-@57|9|1|,|1| @9|5|4|%| 
+@57|9|1|,|1| @9|4|2|%| 
index 354af8ebb534c68d7362ecb4026d00768c6f17a2..f6619c255efc533b963e20ce61cd6730b7677df0 100644 (file)
@@ -17,4 +17,4 @@
 |++0#0000e05#a8a8a8255|-@1| @1|4| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
-| +0#0000000#ffffff0@56|1|0|9|,|1| @8|6|7|%| 
+| +0#0000000#ffffff0@56|1|0|9|,|1| @8|5|2|%| 
index fc403c59b58131562034b43b6900e724550df86b..8e8421409731899ce1eafec2a03ecedfa7b3d3d3 100644 (file)
@@ -17,4 +17,4 @@
 | +0#0000000#ffffff0@74
 |++0#0000e05#a8a8a8255|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|-@47
 | +0#0000000#ffffff0@74
-@57|1|2|7|,|0|-|1| @6|8|0|%| 
+@57|1|2|7|,|0|-|1| @6|6|3|%| 
index 4d519d01024c6ff7693494df3ccc73278ca174af..fb482ff925f40dd4f0c1be3c6a31a34689531c46 100644 (file)
@@ -17,4 +17,4 @@
 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
 | +0#0000000#ffffff0@74
 @75
-@57|1|4|5|,|3|-|1| @6|9|5|%| 
+@57|1|4|5|,|3|-|1| @6|7|4|%| 
index 8ecc5296901ca7bf2820d37ade51dfe99001c366..4b6a2d2cd006239cd8add9b64e3381b950be565f 100644 (file)
@@ -17,4 +17,4 @@
 |d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
 |d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1| @58
 |d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
-@57|1|6|3|,|7|-|1| @6|9@1|%| 
+@57|1|6|3|,|7|-|1| @6|7|8|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_10.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_10.dump
new file mode 100644 (file)
index 0000000..2e986c4
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@74
+|"+0#0000e05&| |d|e|l|e|t|e| |f|u|n|c|t|i|o|n| +0#0000000&@57
+@75
+|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|F|o@1| @59
+|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
+>d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1| @58
+|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
+@75
+@75
+|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54
+@75
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+@57|1|8|1|,|1| @8|9|1|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_11.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_11.dump
new file mode 100644 (file)
index 0000000..174e250
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+>++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|f|u|n|c|t|i|o|n| |F|o@1|(|)|-@45
+| +0#0000000#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9@1|,|0|-|1| @6|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_fold_12.dump b/runtime/syntax/testdir/dumps/vim_ex_function_fold_12.dump
new file mode 100644 (file)
index 0000000..d68f8a1
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+>++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|f|u|n|c|t|i|o|n| |F|o@1|(|)|-@45
+| +0#0000000#ffffff0@74
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|2|1|7|,|5|-|1| @6|B|o|t| 
index b6770ef18502a49a0311b2045d220e967600a153..04aa4ba7871a9218c07c71256bb70a79dd2bc5a0 100644 (file)
@@ -1,20 +1,20 @@
-|++0#0000e05#a8a8a8255|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|-@47
+|d+0#af5f00255#ffffff0|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
+@75
+@75
+|"+0#0000e05&| |f|o|l|d|-|r|e|g|i|o|n| |e|n|d|i|n|g| +0#0000000&@54
+@75
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
 | +0#0000000#ffffff0@74
-|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|x|,| |y| |=| |4|2|,| |z| |=| |"|z|e|d|"|)|-@26
+|++0#0000e05#a8a8a8255|-@1| @1|3| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
 | +0#0000000#ffffff0@74
-|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|-@47
+|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
 | +0#0000000#ffffff0@74
-@75
-|"+0#0000e05&| |c|o|m@1|e|n|t|s| +0#0000000&@64
-@75
 |++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
 | +0#0000000#ffffff0@74
-@75
-|"+0#0000e05&| |d|e|l|e|t|e| |f|u|n|c|t|i|o|n| +0#0000000&@57
-@75
-|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|F|o@1| @59
-|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
-|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n|!| +0#0000000&|F|o@1| @58
-|d+0#af5f00255&|e|l|f|u|n|c|t|i|o|n| +0#0000000&|f|o@1|.+0#af5f00255&|b+0#0000000&|a|r| @55
-> @74
-@57|1|8|3|,|0|-|1| @6|B|o|t| 
+|++0#0000e05#a8a8a8255|-@1| @1|6| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|5| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|o@1|(|)|-@46
+| +0#0000000#ffffff0@74
+|++0#0000e05#a8a8a8255|-@1| @1|2| |l|i|n|e|s|:| |:|f|u|n|c|t|i|o|n| |F|o@1|(|)|-@45
+> +0#0000000#ffffff0@74
+@57|2@1|3|,|0|-|1| @6|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_00.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_00.dump
new file mode 100644 (file)
index 0000000..6f0ca86
--- /dev/null
@@ -0,0 +1,20 @@
+>"+0#0000e05#ffffff0| |V|i|m| |:|d|e|f| |a|n|d| |:|f|u|n|c|t|i|o|n| |c|o|m@1|a|n|d|s| |(|n|e|s|t|e|d|)| +0#0000000&@32
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|F|u|n|A|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@56
+@4|d+0#af5f00255&|e|f| +0#0000000&|D|o|F|u|n|A|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@50
+@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.|"| +0#0000000&@56
+@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|A|(+0#e000e06&|)| +0#0000000&@55
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|F|u|n|B|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@56
+@4|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|D|o|F|u|n|B|(+0#e000e06&|)| +0#0000000&@53
+@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@1|"| +0#0000000&@55
+@4|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|B|(+0#e000e06&|)| +0#0000000&@55
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@59
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_01.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_01.dump
new file mode 100644 (file)
index 0000000..640bdf5
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@3|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|B|(+0#e000e06&|)| +0#0000000&@55
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+>f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@59
+@4|d+0#af5f00255&|e|f| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@50
+@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@54
+@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)| +0#0000000&@55
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@59
+@4|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@53
+@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@3|"| +0#0000000&@53
+@4|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@55
+@57|1|9|,|1| @9|6|8|%| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_99.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_99.dump
new file mode 100644 (file)
index 0000000..6ef83ef
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@3|d+0#af5f00255&|e|f| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@50
+@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@2|"| +0#0000000&@54
+@4|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@64
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|C|(+0#e000e06&|)| +0#0000000&@55
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@59
+@4|f+0#af5f00255&|u|n|c|t|i|o|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@53
+@8|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|.@3|"| +0#0000000&@53
+@4|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@59
+@75
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|D|o|F|u|n|D|(+0#e000e06&|)| +0#0000000&@55
+|e+0#af5f00255&|n|d|f|u|n|c|t|i|o|n| +0#0000000&@63
+@75
+|e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@63
+|e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@63
+|e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@63
+>e+0#af5f00255&|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@63
+@57|3|8|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_00.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_00.dump
new file mode 100644 (file)
index 0000000..7d658b7
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1>"+0&#ffffff0| |V|i|m| |:|d|e|f| |a|n|d| |:|f|u|n|c|t|i|o|n| |c|o|m@1|a|n|d|s| |(|n|e|s|t|e|d|)| +0#0000000&@30
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|A|(|)|:| |s|t|r|i|n|g|-@40
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|B|(|)|:| |s|t|r|i|n|g|-@40
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_01.dump
new file mode 100644 (file)
index 0000000..96c1d34
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|A|(|)|:| |s|t|r|i|n|g|-@40
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| >+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|B|(|)|:| |s|t|r|i|n|g|-@40
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_02.dump
new file mode 100644 (file)
index 0000000..977aaa8
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1>e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|3|7|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_99.dump b/runtime/syntax/testdir/dumps/vim_ex_function_nested_fold_99.dump
new file mode 100644 (file)
index 0000000..ad1fc05
--- /dev/null
@@ -0,0 +1,20 @@
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|i|m| |:|d|e|f| |a|n|d| |:|f|u|n|c|t|i|o|n| |c|o|m@1|a|n|d|s| |(|n|e|s|t|e|d|)| +0#0000000&@30
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |l|e|t| |g|:|v|i|m|s|y|n|_|f|o|l|d|i|n|g| |=| |'|f|'| +0#0000000&@29
+| +0#0000e05#a8a8a8255@1|"+0&#ffffff0| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |s|e|t|l| |f|d|c|=|2| |f|d|m|=|s|y|n|t|a|x| +0#0000000&@34
+| +0#0000e05#a8a8a8255@1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|A|(|)|:| |s|t|r|i|n|g|-@40
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |d|e|f| |F|u|n|B|(|)|:| |s|t|r|i|n|g|-@40
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|C|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+|++0#0000e05#a8a8a8255| |+|-@1| @1|7| |l|i|n|e|s|:| |f|u|n|c|t|i|o|n| |F|u|n|D|(|)|-@43
+| @1| +0#0000000#ffffff0@72
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|A|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|B|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1|e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|C|(+0#e000e06&|)| +0#0000000&@61
+| +0#0000e05#a8a8a8255@1>e+0#af5f00255#ffffff0|c|h|o| +0#0000000&|F|u|n|D|(+0#e000e06&|)| +0#0000000&@61
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|4|0|,|1| @9|A|l@1| 
index 865fc5a919a06414a9804d844c42d220d210ea9c..3326075a3ed45b73b953e0f82091be14bb764cf9 100644 (file)
@@ -108,3 +108,23 @@ def Foo()
   "useless string"
 enddef
 
+
+" fold-region ending
+
+def Foo()
+  # enddef
+enddef
+
+def Foo()
+  echo "enddef"
+enddef
+
+def Foo()
+  let x =<< END
+    endfunction
+  END
+enddef
+
+:def Foo()
+:enddef
+
diff --git a/runtime/syntax/testdir/input/vim_ex_def_nested.vim b/runtime/syntax/testdir/input/vim_ex_def_nested.vim
new file mode 100644 (file)
index 0000000..008c415
--- /dev/null
@@ -0,0 +1,20 @@
+vim9script
+# Vim9 :def command (nested)
+
+class Test
+    const name: string
+
+    def new()
+       def Name(): string
+           function GiveName()
+               return "any"
+           endfunction
+
+           return GiveName()
+       enddef
+
+       this.name = Name()
+    enddef
+endclass
+
+echo Test.new()
diff --git a/runtime/syntax/testdir/input/vim_ex_def_nested_fold.vim b/runtime/syntax/testdir/input/vim_ex_def_nested_fold.vim
new file mode 100644 (file)
index 0000000..601f553
--- /dev/null
@@ -0,0 +1,22 @@
+vim9script
+# Vim9 :def command (nested)
+# VIM_TEST_SETUP let g:vimsyn_folding = 'f'
+# VIM_TEST_SETUP setl fdc=2 fdm=syntax
+
+class Test
+    const name: string
+
+    def new()
+       def Name(): string
+           function GiveName()
+               return "any"
+           endfunction
+
+           return GiveName()
+       enddef
+
+       this.name = Name()
+    enddef
+endclass
+
+echo Test.new()
index f9d9bee47c57784170fb4cc894bbb754fd1b543b..dd260ca45062a07a7d083548516737aa9da4bb5c 100644 (file)
@@ -181,3 +181,43 @@ delfunction foo.bar
 delfunction! Foo
 delfunction foo.bar
 
+
+" fold-region ending
+
+function Foo()
+  " endfunction
+endfunction
+
+function Foo()
+  echo "endfunction"
+endfunction
+
+function Foo()
+  let x =<< END
+    endfunction
+  END
+
+endfunction
+
+function Foo()
+  append
+    endfunction
+.
+endfunction
+
+function Foo()
+  change
+    endfunction
+.
+
+endfunction
+
+function Foo()
+  insert
+    endfunction
+.
+endfunction
+
+:function Foo()
+:endfunction
+
diff --git a/runtime/syntax/testdir/input/vim_ex_function_nested.vim b/runtime/syntax/testdir/input/vim_ex_function_nested.vim
new file mode 100644 (file)
index 0000000..749b572
--- /dev/null
@@ -0,0 +1,38 @@
+" Vim :def and :function commands (nested)
+
+def FunA(): string
+    def DoFunA(): string
+       return "."
+    enddef
+
+    return DoFunA()
+enddef
+
+def FunB(): string
+    function DoFunB()
+       return ".."
+    endfunction
+
+    return DoFunB()
+enddef
+
+function FunC()
+    def DoFunC(): string
+       return "..."
+    enddef
+
+    return DoFunC()
+endfunction
+
+function FunD()
+    function DoFunD()
+       return "...."
+    endfunction
+
+    return DoFunD()
+endfunction
+
+echo FunA()
+echo FunB()
+echo FunC()
+echo FunD()
diff --git a/runtime/syntax/testdir/input/vim_ex_function_nested_fold.vim b/runtime/syntax/testdir/input/vim_ex_function_nested_fold.vim
new file mode 100644 (file)
index 0000000..d966ef3
--- /dev/null
@@ -0,0 +1,40 @@
+" Vim :def and :function commands (nested)
+" VIM_TEST_SETUP let g:vimsyn_folding = 'f'
+" VIM_TEST_SETUP setl fdc=2 fdm=syntax
+
+def FunA(): string
+    def DoFunA(): string
+       return "."
+    enddef
+
+    return DoFunA()
+enddef
+
+def FunB(): string
+    function DoFunB()
+       return ".."
+    endfunction
+
+    return DoFunB()
+enddef
+
+function FunC()
+    def DoFunC(): string
+       return "..."
+    enddef
+
+    return DoFunC()
+endfunction
+
+function FunD()
+    function DoFunD()
+       return "...."
+    endfunction
+
+    return DoFunD()
+endfunction
+
+echo FunA()
+echo FunB()
+echo FunC()
+echo FunD()
index c5f6b6904325c922a9f72fecaecd1ee6256d6731..02d6dde673d70602374e5b236cec929a86d0472d 100644 (file)
@@ -228,9 +228,9 @@ syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper,
 "   (buftype != nofile test avoids having append, change, insert show up in the command window)
 " =======================
 if &buftype != 'nofile'
- syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"          matchgroup=vimCommand end="^\.$""
- syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"          matchgroup=vimCommand end="^\.$""
- syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"          matchgroup=vimCommand end="^\.$""
+ syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"          matchgroup=vimCommand end="^\.$" extend
+ syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"          matchgroup=vimCommand end="^\.$" extend
+ syn region vimInsert  matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"          matchgroup=vimCommand end="^\.$" extend
 endif
 
 " Behave! {{{2
@@ -281,12 +281,14 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
  syn match     vimOperError    ")"
 endif
 
-" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
+" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
 " =========
 syn cluster    vimFuncList     contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag
 syn cluster    vimDefList      contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag
-syn cluster    vimFuncBodyList contains=@vimCmdList,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimLetHereDoc,vimLineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst
-syn cluster    vimDefBodyList  contains=@vimCmdList,vimCmplxRepeat,vim9Comment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vim9LineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst
+
+syn cluster    vimFuncBodyCommon       contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold
+syn cluster    vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert
+syn cluster    vimDefBodyList  contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment
 
 syn region     vimFuncPattern  contained               matchgroup=vimOper start="/" end="$" contains=@vimSubstList
 syn match      vimFunction     "\<fu\%[nction]\>"      skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
@@ -321,9 +323,9 @@ syn match   vimEndfunction  "\<endf\%[unction]\>"
 syn match      vimEnddef       "\<enddef\>"
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
- syn region    vimFuncFold     start="\<fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*("        end="\<endf\%[unction]\>" contains=vimFunction fold keepend transparent
- syn region    vimFuncFold     start="\<def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+("               end="\<enddef\>"                contains=vimDef      fold keepend transparent
- syn region    vimFuncFold     start="\<def\s\+new\i\+("                               end="\<enddef\>"                contains=vimDef      fold keepend transparent
+ syn region    vimFuncFold     start="^\s*:\=\s*fu\%[nction]\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*("        end="^\s*:\=\s*endf\%[unction]\>" contains=vimFunction fold keepend extend transparent
+ syn region    vimFuncFold     start="^\s*:\=\s*def\>!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+("               end="^\s*:\=\s*enddef\>"          contains=vimDef      fold keepend extend transparent
+ syn region    vimFuncFold     start="^\s*:\=\s*def\s\+new\i\+("                                       end="^\s*:\=\s*enddef\>"          contains=vimDef      fold keepend extend transparent
 endif
 
 syn match      vimFuncVar   contained  "a:\%(\K\k*\|\d\+\)\>"
@@ -540,7 +542,7 @@ syn keyword vimUnlet        unl[et]         skipwhite nextgroup=vimUnletBang,vimUnletVars
 syn match      vimUnletBang    contained       "!"     skipwhite nextgroup=vimUnletVars
 syn region     vimUnletVars    contained       start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
 
-VimFoldh syn region vimLetHereDoc      matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
+VimFoldh syn region vimLetHereDoc      matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' extend
 syn keyword    vimLet  var             skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
 
 " For: {{{2