mirror of
https://github.com/vim/vim.git
synced 2025-11-14 23:04:02 -05:00
runtime(vim): Update base syntax, match Vim9 object type constructor
fixes: #18677. closes: #18691 Reported by Aliaksei Budavei. Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
47c30bb03a
commit
59f0ea5b3e
@@ -2,7 +2,7 @@
|
||||
" Language: Vim script
|
||||
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
|
||||
" Doug Kearns <dougkearns@gmail.com>
|
||||
" Last Change: 2025 Nov 04
|
||||
" Last Change: 2025 Nov 07
|
||||
" Former Maintainer: Charles E. Campbell
|
||||
|
||||
" DO NOT CHANGE DIRECTLY.
|
||||
@@ -629,13 +629,20 @@ syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType conta
|
||||
syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType
|
||||
syn keyword vimType contained blob bool channel float job number string void
|
||||
syn keyword vimTypeAny contained any
|
||||
syn region vimTypeObject contained
|
||||
\ matchgroup=vimType
|
||||
\ start="\<object<"
|
||||
\ end=">"
|
||||
\ contains=vimTypeAny,vimTypeObject,vimUserType
|
||||
\ oneline
|
||||
\ transparent
|
||||
syn match vimType contained "\<\%(func\)\>"
|
||||
syn region vimCompoundType contained matchgroup=vimType start="\<func(" end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent
|
||||
syn region vimCompoundType contained matchgroup=vimType start="\<tuple<" end=">" contains=@vim9Continue,@vimType transparent
|
||||
syn region vimCompoundType contained matchgroup=vimType start="\<\%(list\|dict\)<" end=">" contains=@vimType oneline transparent
|
||||
syn match vimUserType contained "\<\%(\h\w*\.\)*\u\w*\>"
|
||||
|
||||
syn cluster vimType contains=vimType,vimTypeAny,vimCompoundType,vimUserType
|
||||
syn cluster vimType contains=vimType,vimTypeAny,vimTypeObject,vimCompoundType,vimUserType
|
||||
|
||||
" Classes, Enums And Interfaces: {{{2
|
||||
" =============================
|
||||
@@ -1186,6 +1193,13 @@ syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@
|
||||
syn match vim9VariableTypeSep contained "\S\@1<=:\%(\s\|\n\)\@=" skipwhite nextgroup=@vim9VariableType
|
||||
syn keyword vim9VariableType contained blob bool channel float job number string void skipwhite nextgroup=vimLetHeredoc
|
||||
syn keyword vim9VariableTypeAny contained any skipwhite nextgroup=vimLetHeredoc
|
||||
syn region vim9VariableTypeObject contained
|
||||
\ matchgroup=vimType
|
||||
\ start="\<object<"
|
||||
\ end=">"
|
||||
\ contains=vimTypeAny,vimTypeObject,vimUserType
|
||||
\ oneline
|
||||
\ transparent
|
||||
syn match vim9VariableType contained "\<\%(func\)\>" skipwhite nextgroup=vimLetHeredoc
|
||||
syn region vim9VariableCompoundType contained
|
||||
\ matchgroup=vim9VariableType
|
||||
@@ -1211,7 +1225,7 @@ syn region vim9VariableCompoundType contained
|
||||
\ transparent
|
||||
syn match vim9VariableUserType contained "\<\%(\h\w*\.\)*\u\w*\>" skipwhite nextgroup=vimLetHeredoc
|
||||
|
||||
syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableCompoundType,vim9VariableUserType
|
||||
syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableTypeObject,vim9VariableCompoundType,vim9VariableUserType
|
||||
|
||||
" Lockvar and Unlockvar: {{{2
|
||||
" =====================
|
||||
@@ -2648,6 +2662,7 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vimTodo Todo
|
||||
hi def link vimType Type
|
||||
hi def link vimTypeAny vimType
|
||||
hi def link vimTypeObject vimType
|
||||
hi def link vimUniq vimCommand
|
||||
hi def link vimUniqBang vimBang
|
||||
hi def link vimUniqOptions Special
|
||||
@@ -2739,7 +2754,8 @@ if !exists("skip_vim_syntax_inits")
|
||||
hi def link vim9TypeEquals vimOper
|
||||
hi def link vim9Variable vimVar
|
||||
hi def link vim9VariableType vimType
|
||||
hi def link vim9VariableTypeAny vimType
|
||||
hi def link vim9VariableTypeAny vimTypeAny
|
||||
hi def link vim9VariableTypeObject vimTypeObject
|
||||
hi def link vim9Var vimCommand
|
||||
hi def link vim9Vim9ScriptArg Special
|
||||
hi def link vim9Vim9Script vimCommand
|
||||
|
||||
Reference in New Issue
Block a user