commit 0ebb2ec4e43df20a48104407a601aafeeccbb360
parent 22f6b9d11fbe19c1ac2125d83e220ac40831ddbc
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon, 29 Sep 2025 09:15:03 +0800
vim-patch:4de931d: runtime(vim): Update base syntax, match enum constructor type args
closes: vim/vim#17840
https://github.com/vim/vim/commit/4de931daae88784aacd1dc4ecd92ca6fb4a45977
Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
@@ -692,12 +692,19 @@ if s:vim9script
syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment
" enforce enum value list location
- syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment
+ syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueTypeArgs,vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment
syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment
syn region vim9EnumValueListCommaComment contained
\ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$"
\ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue
\ contains=@vimCommentGroup,vimCommentString
+ syn region vim9EnumValueTypeArgs contained
+ \ matchgroup=Delimiter
+ \ start="<\ze\a"
+ \ end=">"
+ \ nextgroup=vim9EnumValueArgList
+ \ contains=@vimType
+ \ oneline
syn region vim9EnumValueArgList contained
\ matchgroup=vimParenSep start="(" end=")"
\ nextgroup=vim9EnumValueListComma