From 4091f2c74040c3e92f504e727d7533e09ef84d3a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 1 Jun 2025 08:31:56 +0800 Subject: [PATCH] vim-patch:7b5550f: runtime(vim): Update base-syntax, improve :import highlighting - Match "autoload" as a keyword in :import commands. - Match an expression argument for the filename. closes: vim/vim#15375 https://github.com/vim/vim/commit/7b5550fac7d37f35285c78a8e74674817a7cfc99 Co-authored-by: Doug Kearns --- runtime/syntax/vim.vim | 48 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 328522eef0..5d41f68db5 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -219,7 +219,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,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimFor,vimFunction,vimFuncFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimThrow,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,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimFor,vimFunction,vimFuncFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,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=@vimComment +syn match vimImport "\" skipwhite nextgroup=vimImportAutoload,vimImportFilename + " Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 " ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue @@ -1878,7 +1919,7 @@ if exists("g:vimsyn_minlines") endif exe "syn sync maxlines=".s:vimsyn_maxlines syn sync linecont "^\s\+\\" -syn sync linebreaks=1 +syn sync linebreaks=2 syn sync match vimAugroupSyncA groupthere NONE "\\s\+[eE][nN][dD]" " ==================== @@ -2012,6 +2053,9 @@ if !exists("skip_vim_syntax_inits") hi def link vimHiStartStop vimHiTerm hi def link vimHiTerm Type hi def link vimHLGroup vimGroup + hi def link vimImport vimCommand + hi def link vimImportAutoload Special + hi def link vimImportAs vimImport hi def link vimInsert vimString hi def link vim9KeymapLineComment vimKeymapLineComment hi def link vimKeymapLineComment vimComment