runtime(vim): Update base-syntax, match protected constructors

Support for protected constructors was added in commit 7e89800.

closes: 16618

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Doug Kearns
2025-03-23 16:14:20 +01:00
committed by Christian Brabandt
parent b5459ee104
commit adb703e1b9
4 changed files with 45 additions and 6 deletions

View File

@ -526,7 +526,7 @@ if s:vim9script
\ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError
\ contains=vimDefParam,vim9Comment,vimFuncParamEquals
syn match vim9ConstructorDefName contained "\<new\w*\>"
syn match vim9ConstructorDefName contained "\<_\=new\w*\>"
\ nextgroup=vim9ConstructorDefParams
\ contains=@vim9MethodName
syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>"
@ -563,14 +563,14 @@ if s:vim9script
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror")
syn match vim9MethodNameError contained "\<[a-z0-9]\i\>"
endif
syn match vim9MethodName contained "\<new\w*\>"
syn match vim9MethodName contained "\<_\=new\w*\>"
syn keyword vim9MethodName contained empty len string
syn cluster vim9MethodName contains=vim9MethodName,vim9MethodNameError
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
syn region vim9MethodDefFold contained start="\%(^\s*\%(:\=static\s\+\)\=\)\@16<=:\=def\s\+\h\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
syn region vim9MethodDefFold contained start="^\s*:\=def\s\+new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
syn region vim9MethodDefFold contained start="^\s*:\=def\s\+_\=new\i*(" end="^\s*:\=enddef\>" contains=vim9MethodDef fold keepend extend transparent
endif
syn cluster vim9MethodDef contains=vim9MethodDef,vim9MethodDefFold