neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit d954763b85665bdeb14e4ba042981906cc51c1f3
parent 94f1abf89cb17a9d739eb96a7f3c6eab03a8e14c
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Wed, 24 Sep 2025 10:22:46 +0800

vim-patch:b1446df: runtime(vim): Update base syntax, match :wincmd (#35898)

Match the full :wincmd command syntax.

Allow for oneline assignment to Vim9 variables named winc[md].

Fixes vim/vim#18368.

https://github.com/vim/vim/commit/b1446dfd23eb95743cda8cec8a6aac6e697c5fbe

Co-authored-by: Doug Kearns <dougkearns@gmail.com>
Diffstat:
Mruntime/syntax/vim.vim | 14+++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim @@ -232,7 +232,7 @@ syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vi syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDefer,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimEval,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFiletype,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSynColor,vimSynLink,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDefer,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimEval,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFiletype,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSynColor,vimSynLink,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimWincmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var syn match vimCmdSep "\\\@1<!|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc syn match vimCmdSep ":\+" skipwhite nextgroup=@vimCmdList,vimSubst1 @@ -1573,6 +1573,17 @@ syn region vimUniqPattern contained syn cluster vimUniqOptions contains=vimUniqOptions,vimUniqOptionsError +" Wincmd: {{{2 +" ====== +syn match vimWincmd "\<winc\%[md]\>" skipwhite nextgroup=vimWincmdArg +" TODO: consider extracting this list from the help file +syn match vimWincmdArg contained + \ "\<[sSvnqojkhlwWtbpPrRxKJHLTfFz]\>\|[\^:=\-+_<>|\]}]\|\<g\s\+[\]}]\|\<g[fFtT]\>" + \ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment + +" only handles oneline assignments +Vim9 syn match vimWincmd "\s\=\<winc\%[md]\>\ze\s\+=\s*\%([#|]\|$\)" skipwhite nextgroup=vimWincmdArg + " Syntax: {{{2 "======= syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial @@ -2513,6 +2524,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimWildcardInterval vimWildcard hi def link vimWildcardQuestion vimWildcard hi def link vimWildcardStar vimWildcard + hi def link vimWinCmd vimCommand hi def link vim9Abstract vimCommand hi def link vim9Boolean Boolean