From 0456d75517f11f84e370e0d4ffbd370062ebd242 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 19 Jun 2025 07:49:15 +0800 Subject: [PATCH] vim-patch:8311e7d: runtime(vim): fix incorrect highlighting of User autocmds (#34570) There is no pattern after the user event name. The user event name is the pattern. closes: vim/vim#17568 https://github.com/vim/vim/commit/8311e7d6b4cf92cb90ee6abace271834e9af66f2 --- runtime/syntax/vim.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index fce57cfbb1..1ba4bc3ceb 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -78,7 +78,7 @@ syn keyword vimErrSetting contained invakm invaltkeymap invanti invantialias inv syn case ignore syn keyword vimAutoEvent contained User skipwhite nextgroup=vimUserAutoEvent -syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern +syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimUserAutoEventSep,vimAutocmdMod,vimAutocmdBlock " Highlight commonly used Groupnames {{{2 syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo @@ -1193,6 +1193,7 @@ syn match vimAutocmdMod contained "++once\>" skipwhite nextgroup=vimAutocmdMod,v " higher priority than vimAutocmdGroup, assume no group is so named syn match vimAutoEventGlob contained "*" skipwhite nextgroup=@vimAutocmdPattern syn match vimAutoEventSep contained "\a\@1<=," nextgroup=vimAutoEvent,nvimAutoEvent +syn match vimUserAutoEventSep contained "\a\@1<=," nextgroup=vimUserAutoEvent syn match vimAutocmd "\" skipwhite nextgroup=vimAutocmdBang,vimAutocmdGroup,vimAutoEvent,nvimAutoEvent,vimAutoEventGlob