From 3c66e285cc4e7bc9953945caac91049463dc1d75 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 10 Mar 2024 10:19:15 +0800 Subject: vim-patch:a2c65809dafe MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime(java): Recognise string templates (vim/vim#14150) As this is encouraged in the referenced JEPs, "to visually distinguish a string template from a string literal, and a text block template from a text block", the default colours for java\%[Debug]StrTempl are made distinct from java\%[Debug]String. According to §3.2 Lexical Translations (JLS, c. 1996 or any more recent version), line terminators, white space, and comments are discarded before tokens are accepted. Since a template expression comprises a template processor, a dot, and a template, it may be visually appealing to break up its head across a few lines whenever its tail already spans multiple lines. Curiously, no allowance for it is made in the distributed tests for OpenJDK 21; the proposed regexp patterns take in consideration a line terminator and white space after a dot. References: https://openjdk.org/jeps/430 (Preview) https://openjdk.org/jeps/459 (Second Preview) https://openjdk.org/jeps/465 https://github.com/vim/vim/commit/a2c65809dafe5c4f45f278fddf368c7c971d83e9 Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com> --- runtime/syntax/java.vim | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index f6d2660277..c059de603c 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2024 Mar 02 +" Last Change: 2024 Mar 06 " Please check :help java.vim for comments on some of the options available. @@ -187,8 +187,8 @@ if exists("java_comment_strings") syn match javaCommentCharacter contained "'\\[^']\{1,6\}'" contains=javaSpecialChar syn match javaCommentCharacter contained "'\\''" contains=javaSpecialChar syn match javaCommentCharacter contained "'[^\\]'" - syn cluster javaCommentSpecial add=javaCommentString,javaCommentCharacter,javaNumber - syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber + syn cluster javaCommentSpecial add=javaCommentString,javaCommentCharacter,javaNumber,javaStrTempl + syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber,javaStrTempl endif syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell @@ -234,6 +234,9 @@ syn match javaSpecialChar contained "\\\%(u\x\x\x\x\|[0-3]\o\o\|\o\o\=\|[bstn syn region javaString start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaSpecialError,@Spell syn region javaString start=+"""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell syn match javaTextBlockError +"""\s*"""+ +syn region javaStrTemplEmbExp contained matchgroup=javaStrTempl start="\\{" end="}" contains=TOP +syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,@Spell +syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell " The next line is commented out, it can cause a crash for a long line "syn match javaStringError +"\%([^"\\]\|\\.\)*$+ syn match javaCharacter "'[^']*'" contains=javaSpecialChar,javaSpecialCharError @@ -254,7 +257,7 @@ syn match javaNumber "\<0[xX]\%(\x\%(_*\x\)*\.\=\|\%(\x\%(_*\x\)*\)\=\.\x\%( " Unicode characters syn match javaSpecial "\\u\x\x\x\x" -syn cluster javaTop add=javaString,javaCharacter,javaNumber,javaSpecial,javaStringError,javaTextBlockError +syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpecial,javaStringError,javaTextBlockError if exists("java_highlight_functions") if java_highlight_functions == "indent" @@ -280,7 +283,12 @@ if exists("java_highlight_debug") syn match javaDebugSpecial contained "\\\%(u\x\x\x\x\|[0-3]\o\o\|\o\o\=\|[bstnfr"'\\]\)" syn region javaDebugString contained start=+"+ end=+"+ contains=javaDebugSpecial syn region javaDebugString contained start=+"""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugSpecial,javaDebugTextBlockError -" The next line is commented out, it can cause a crash for a long line + " The highlight groups of java{StrTempl,Debug{,Paren,StrTempl}}\, + " share one colour by default. Do not conflate unrelated parens. + syn region javaDebugStrTemplEmbExp contained matchgroup=javaDebugStrTempl start="\\{" end="}" contains=javaComment,javaLineComment,javaDebug\%(Paren\)\@!.* + syn region javaDebugStrTempl contained start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaDebugStrTemplEmbExp,javaDebugSpecial + syn region javaDebugStrTempl contained start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugStrTemplEmbExp,javaDebugSpecial,javaDebugTextBlockError + " The next line is commented out, it can cause a crash for a long line " syn match javaDebugStringError contained +"\%([^"\\]\|\\.\)*$+ syn match javaDebugTextBlockError contained +"""\s*"""+ syn match javaDebugCharacter contained "'[^\\]'" @@ -307,6 +315,7 @@ if exists("java_highlight_debug") hi def link javaDebug Debug hi def link javaDebugString DebugString + hi def link javaDebugStrTempl Macro hi def link javaDebugStringError javaError hi def link javaDebugTextBlockError javaDebugStringError hi def link javaDebugType DebugType @@ -376,6 +385,7 @@ hi def link javaSpecial Special hi def link javaSpecialError Error hi def link javaSpecialCharError Error hi def link javaString String +hi def link javaStrTempl Macro hi def link javaCharacter Character hi def link javaSpecialChar SpecialChar hi def link javaNumber Number -- cgit From 84b6ae82c728403480cfb5b876643c7fe1c08515 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 10 Mar 2024 10:18:35 +0800 Subject: vim-patch:62b26040eb4b runtime(vim): Update base-syntax, improve :menu{,translate} highlighting (vim/vim#14162) Improve :menu and :menutranslate highlighting. - Match args to :menutranslation and :popup. - Only highlight special notation in {rhs} of :menu, like :map. - Allow line continuations in {rhs} of :menu and between {english} and {mylang} of :menutranslation, matching common usage. - Bug fixes. https://github.com/vim/vim/commit/62b26040eb4b6752be2c46852e8986083737a1bb Co-authored-by: dkearns --- runtime/syntax/vim.vim | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 2857146949..77e9735b78 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -154,7 +154,7 @@ syn match vimNumber '0[0-7]\+' skipwhite nextgroup=vimGlobal,vimSubst1,v syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" @@ -468,16 +468,28 @@ syn case match " Menus: {{{2 " ===== -syn cluster vimMenuList contains=vimMenuBang,vimMenuPriority,vimMenuName,vimMenuMod -" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimCommand', END_STR='skipwhite nextgroup=@vimMenuList' -syn keyword vimCommand am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] sme[nu] snoreme[nu] sunme[nu] tlm[enu] tln[oremenu] tlu[nmenu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu] skipwhite nextgroup=@vimMenuList -syn match vimMenuName "[^ \t\\<]\+" contained nextgroup=vimMenuNameMore,vimMenuMap -syn match vimMenuPriority "\d\+\(\.\d\+\)*" contained skipwhite nextgroup=vimMenuName -syn match vimMenuNameMore "\c\\\s\|\|\\\." contained nextgroup=vimMenuName,vimMenuNameMore contains=vimNotation -syn match vimMenuMod contained "\c<\(script\|silent\)\+>" skipwhite contains=vimMapModKey,vimMapModErr nextgroup=@vimMenuList -syn match vimMenuMap "\s" contained skipwhite nextgroup=vimMenuRhs -syn match vimMenuRhs ".*$" contained contains=vimString,vimComment,vim9Comment,vimIsCommand -syn match vimMenuBang "!" contained skipwhite nextgroup=@vimMenuList +" NOTE: tail comments disallowed +" GEN_SYN_VIM: vimCommand menu, START_STR='syn keyword vimMenu', END_STR='skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus' +syn keyword vimMenu am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] ime[nu] inoreme[nu] iunme[nu] me[nu] nme[nu] nnoreme[nu] noreme[nu] nunme[nu] ome[nu] onoreme[nu] ounme[nu] sme[nu] snoreme[nu] sunme[nu] tlm[enu] tln[oremenu] tlu[nmenu] tm[enu] tu[nmenu] unme[nu] vme[nu] vnoreme[nu] vunme[nu] xme[nu] xnoreme[nu] xunme[nu] skipwhite nextgroup=vimMenuBang,vimMenuMod,vimMenuName,vimMenuPriority,vimMenuStatus +syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName +syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" +syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" +syn match vimMenuName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs +syn match vimMenuName "\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue +syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained +syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName +syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr +syn keyword vimMenuStatus enable disable nextgroup=vimMenuName skipwhite +syn match vimMenuBang "\a\@1<=!" contained skipwhite nextgroup=vimMenuName,vimMenuMod + +syn region vimMenutranslate + \ matchgroup=vimCommand start="\" + \ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + + \ end="$" matchgroup=vimCmdSep end="|" matchgroup=vimMenuClear end="\\s\+[eE][nN][dD]" " ==================== @@ -1010,9 +1023,14 @@ if !exists("skip_vim_syntax_inits") hi def link vimMark Number hi def link vimMarkNumber vimNumber hi def link vimMenuBang vimBang + hi def link vimMenuClear Special hi def link vimMenuMod vimMapMod - hi def link vimMenuNameMore vimMenuName hi def link vimMenuName PreProc + hi def link vimMenu vimCommand + hi def link vimMenuNotation vimNotation + hi def link vimMenuPriority Number + hi def link vimMenuStatus Special + hi def link vimMenutranslateComment vimComment hi def link vimMtchComment vimComment hi def link vimNorm vimCommand hi def link vimNotation Special -- cgit From b5f870cf12c768984536cda2fd6b1519045b8c78 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 10 Mar 2024 10:21:34 +0800 Subject: vim-patch:5d67aef3060d runtime(vim): Update base-syntax, improve :map highlighting (vim/vim#14141) Improve :map command highlighting. - Fix multiline RHS matching, allow continued lines and comments. - Allow ^V-escaped whitespace in LHS. - Handle map-bar properly and allow trailing commands. Fixes issue vim/vim#12672. https://github.com/vim/vim/commit/5d67aef3060d6d3aa14d273c39f23d8a90c4cef1 Co-authored-by: dkearns --- runtime/syntax/vim.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 77e9735b78..6d535c5e7e 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -457,11 +457,13 @@ syn keyword vimMap cmapc[lear] imapc[lear] lmapc[lear] nmapc[lear] omapc[lear] s syn keyword vimMap mapc[lear] skipwhite nextgroup=vimMapBang,vimMapMod " GEN_SYN_VIM: vimCommand unmap, START_STR='syn keyword vimUnmap', END_STR='skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs' syn keyword vimUnmap cu[nmap] iu[nmap] lu[nmap] nun[map] ou[nmap] sunm[ap] tunma[p] unm[ap] vu[nmap] xu[nmap] skipwhite nextgroup=vimMapBang,vimMapMod,vimMapLhs -syn match vimMapLhs contained "\S\+" contains=vimNotation,vimCtrlChar skipwhite nextgroup=vimMapRhs -syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs +syn match vimMapLhs contained "\%(.\|\S\)\+" contains=vimCtrlChar,vimNotation skipwhite nextgroup=vimMapRhs +syn match vimMapLhs contained "\%(.\|\S\)\+\ze\s*$" contains=vimCtrlChar,vimNotation skipwhite skipnl nextgroup=vimMapRhsContinue +syn match vimMapBang contained "\a\@1<=!" skipwhite nextgroup=vimMapMod,vimMapLhs syn match vimMapMod contained "\%#=1\c<\(buffer\|expr\|\(local\)\=leader\|nowait\|plug\|script\|sid\|unique\|silent\)\+>" contains=vimMapModKey,vimMapModErr skipwhite nextgroup=vimMapMod,vimMapLhs -syn match vimMapRhs contained ".*" contains=vimNotation,vimCtrlChar skipnl nextgroup=vimMapRhsExtend -syn match vimMapRhsExtend contained "^\s*\\.*$" contains=vimContinue +syn region vimMapRhs contained start="\S" skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation skipnl nextgroup=vimMapRhsContinue +" assume a continuation comment introduces the RHS +syn region vimMapRhsContinue contained start=+^\s*\%(\\\|"\\ \)+ skip=+\\|\|\@1<=|\|\n\s*\\\|\n\s*"\\ + end="|" end="$" contains=@vimContinue,vimCtrlChar,vimNotation syn case ignore syn keyword vimMapModKey contained buffer expr leader localleader nowait plug script sid silent unique syn case match @@ -1134,4 +1136,4 @@ delc VimFoldr delc VimFoldt let &cpo = s:keepcpo unlet s:keepcpo -" vim:ts=18 fdm=marker +" vim:ts=18 fdm=marker ft=vim -- cgit From 59e3bcfb00f18ce5ee6643f0c6d303afb6c7c046 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 12 Mar 2024 07:20:04 +0800 Subject: vim-patch:5cd86c6cff94 (#27822) runtime(vim): Update base-syntax, improve number matching (vim/vim#14175) - Limit blob literals to an even number of hexadecimal digits and correctly located dots. - Match octal numbers. The current version unsuccessfully attempts to match a leading '-' as part of the float literal. It's actually parsed as part of the literal for all numbers but the syntax file hasn't matched it like that for a long time and highlights negative numbers as UNARY-MINUS NUMBER. This will be fixed when better expression matching is implemented. https://github.com/vim/vim/commit/5cd86c6cff94256ed2db872c46b57da259a648ac Co-authored-by: dkearns --- runtime/syntax/vim.vim | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 6d535c5e7e..3141e806d1 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -145,13 +145,14 @@ endif " Numbers {{{2 " ======= -syn match vimNumber '\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0[xX]\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '\<0[zZ][a-zA-Z0-9.]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '0[0-7]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment -syn match vimNumber '0[bB][01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn case ignore +syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn case match " All vimCommands are contained by vimIsCommand. {{{2 syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate -- cgit From b958b5ee4f1eb3ce7ebae8222132e201f855e1ce Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 15 Mar 2024 21:46:38 +0800 Subject: vim-patch:61887b3d6fd8 runtime(vim): Update base-syntax, improve :echo and :execute highlighting (vim/vim#14199) Improve :echo and :execute highlighting. - Add better line-continuation support for both commands. - Improve the :execute command's expression argument matching. - Remove the fix for issue vim/vim#9987 as this is now handled by correctly matching the parens in :echo (...) as operator parens. https://github.com/vim/vim/commit/61887b3d6fd8b441c90416ea7855e1fe5a9ae32c Co-authored-by: dkearns --- runtime/syntax/vim.vim | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 3141e806d1..8d0da8e21f 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -155,7 +155,7 @@ syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSub syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimEcho,vimEchoHL,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,@vimEcho,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" @@ -436,16 +436,27 @@ syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" " Echo And Execute: -- prefer strings! {{{2 " ================ -" GEN_SYN_VIM: vimCommand echo, START_STR='syn keyword vimEcho', END_STR='skipwhite nextgroup=vimEchoExpr' -syn keyword vimEcho ec[ho] echoe[rr] echom[sg] echoc[onsole] echon echow[indow] skipwhite nextgroup=vimEchoExpr -syn region vimEchoExpr contained start="[^[:space:]|]" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" end="$" contains=@vimContinue,@vimExprList - -syn match vimEchoHL "\" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchoHLNone,vimOnlyHLGroup,nvimHLGroup +" NOTE: No trailing comments + +syn region vimEcho + \ matchgroup=vimCommand + \ start="\" + \ start="\" + \ start="\" + \ start="\" + \ start="\" + \ start="\" + \ skip=+\\|\|\n\s*\\\|\n\s*"\\ + + \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent + +syn match vimEchohl "\" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone,vimOnlyHLGroup,nvimHLGroup syn case ignore -syn keyword vimEchoHLNone none +syn keyword vimEchohlNone contained none syn case match -syn region vimExecute oneline excludenl matchgroup=vimCommand start="\" skip="\(\\\\\)*\\|" end="$\||\|<[cC][rR]>" contains=vimFuncVar,vimIsCommand,vimOper,vimNotation,vimOperParen,vimString,vimVar +syn cluster vimEcho contains=vimEcho.* + +syn region vimExecute matchgroup=vimCommand start="\" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent " Maps: {{{2 " ==== @@ -520,9 +531,8 @@ syn case match " User Function Highlighting: {{{2 " (following Gautam Iyer's suggestion) " ========================== -syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute +syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation -syn keyword vimFuncEcho contained ec ech echo " User Command Highlighting: {{{2 syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' @@ -965,8 +975,8 @@ if !exists("skip_vim_syntax_inits") hi def link vimContinueComment vimComment hi def link vimCtrlChar SpecialChar hi def link vimEcho vimCommand - hi def link vimEchoHLNone vimGroup - hi def link vimEchoHL vimCommand + hi def link vimEchohlNone vimGroup + hi def link vimEchohl vimCommand hi def link vimElseIfErr Error hi def link vimElseif vimCondHL hi def link vimEnvvar PreProc -- cgit From b82d755109d838267acac225e793eee560a3df4e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 16 Mar 2024 04:08:56 +0800 Subject: vim-patch:b4b3d7de2413 runtime(vim): Update base-syntax, revert last change to vimUserFunc (vim/vim#14202) Fix highlighting of ":echo (expr)" (broken in commit 61887b3) by re-enabling the original fix for vim/vim#9987. Addresses https://github.com/vim/vim/pull/14199#issuecomment-1999732062. This will be fixed more generally when there is context-sensitive matching for commands and functions. https://github.com/vim/vim/commit/b4b3d7de2413bf277445ea724c9cbd5e6bf9a334 Co-authored-by: dkearns --- runtime/syntax/vim.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 8d0da8e21f..e8f071f8d5 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -531,8 +531,10 @@ syn case match " User Function Highlighting: {{{2 " (following Gautam Iyer's suggestion) " ========================== -syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncName,vimUserFunc,vimExecute -syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation +syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute +syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation +syn keyword vimFuncEcho contained ec ech echo + " User Command Highlighting: {{{2 syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' -- cgit From f0bd895995f8ef1a09fd942d6f8c3d096a6ac879 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 18 Mar 2024 08:30:40 +0100 Subject: vim-patch:3d46de703cf6 runtime(go): `goPackageComment` highlighting too broad Previously this would highlight any comment before a line starting `package`, for example var ( // This comment would be highlighted as a goPackageComment packages []string ) The package clause is only valid when followed by a space[1], so include this restriction This is upstreaming a change from `go-vim`[2] [1] https://go.dev/ref/spec#Package_clause [2] https://github.com/fatih/vim-go/commit/d1c36cc4173093d0be78fd826978a024febe6233 https://github.com/vim/vim/commit/3d46de703cf645032fa4dbcd71259176db1b46b7 Co-authored-by: Matthew Hughes --- runtime/syntax/go.vim | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim index ba776f949c..8685867c27 100644 --- a/runtime/syntax/go.vim +++ b/runtime/syntax/go.vim @@ -5,7 +5,8 @@ " go.vim: Vim syntax file for Go. " Language: Go " Maintainer: Billie Cleek -" Latest Revision: 2024-01-21 +" Latest Revision: 2024-03-17 +" 2024-03-17: - fix goPackageComment highlight (by Vim Project) " License: BSD-style. See LICENSE file in source repository. " Repository: https://github.com/fatih/vim-go @@ -531,12 +532,12 @@ if s:HighlightBuildConstraints() || s:FoldEnable('package_comment') " matched as comments to avoid looking like working build constraints. " The he, me, and re options let the "package" itself be highlighted by " the usual rules. - exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package/' - \ . ' end=/\v\n\s*package/he=e-7,me=e-7,re=e-7' + exe 'syn region goPackageComment start=/\v(\/\/.*\n)+\s*package\s/' + \ . ' end=/\v\n\s*package\s/he=e-8,me=e-8,re=e-8' \ . ' contains=@goCommentGroup,@Spell' \ . (s:FoldEnable('package_comment') ? ' fold' : '') - exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage/' - \ . ' end=/\v\*\/\n\s*package/he=e-7,me=e-7,re=e-7' + exe 'syn region goPackageComment start=/\v^\s*\/\*.*\n(.*\n)*\s*\*\/\npackage\s/' + \ . ' end=/\v\*\/\n\s*package\s/he=e-8,me=e-8,re=e-8' \ . ' contains=@goCommentGroup,@Spell' \ . (s:FoldEnable('package_comment') ? ' fold' : '') hi def link goPackageComment Comment -- cgit From e34c23b7016aee5ac6483ab53fed1bce037cec5a Mon Sep 17 00:00:00 2001 From: En-En <39373446+En-En-Code@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:19:20 +0000 Subject: fix(tutor): set a value for ":syntax iskeyword" (#27833) Problem: "NOTE"s, inline Vim script code, and links ending in digits may not be highlighted correctly within the :Tutor. Solution: set an explicit value for ":syntax iskeyword" that includes digits. Do it after ":syntax include"s, so the included syntax/sh.vim doesn't mess with the value. Increase screen test width so all text within the conclusion section is visible. Co-authored-by: Sean Dewar <6256228+seandewar@users.noreply.github.com> --- runtime/syntax/tutor.vim | 2 ++ 1 file changed, 2 insertions(+) (limited to 'runtime/syntax') diff --git a/runtime/syntax/tutor.vim b/runtime/syntax/tutor.vim index 83ca547fdd..399026790a 100644 --- a/runtime/syntax/tutor.vim +++ b/runtime/syntax/tutor.vim @@ -8,6 +8,8 @@ syn include @TUTORSHELL syntax/sh.vim unlet b:current_syntax syn include @VIMNORMAL syntax/vimnormal.vim +syn iskeyword @,-,_,48-57 + syn match tutorLink /\[.\{-}\](.\{-})/ contains=tutorInlineNormal syn match tutorLinkBands /\[\|\]\|(\|)/ contained containedin=tutorLink,tutorLinkAnchor conceal syn match tutorLinkAnchor /(.\{-})/ contained containedin=tutorLink conceal -- cgit From b5e3df37a436b7760495ce0d44f9dcb009915149 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 19 Mar 2024 06:38:30 +0800 Subject: vim-patch:9530fe4f3a69 (#27919) runtime(vim): Update base-syntax, improve :highlight command (vim/vim#14228) Improve :highlight command highlighting - Use the same highlight groups for "default link" with and without bang. - Match some common line-continuation use. - Match :hi clear variants. - Highlight color-name values. Resync vim.vim and generator/vim.vim.base. https://github.com/vim/vim/commit/9530fe4f3a69c6bd11fc745d3b2d1667cdd0cf6d Co-authored-by: dkearns --- runtime/syntax/vim.vim | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index e8f071f8d5..1cd2bdc568 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -535,7 +535,6 @@ syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\ syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation syn keyword vimFuncEcho contained ec ech echo - " User Command Highlighting: {{{2 syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' @@ -669,7 +668,7 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror") syn match vimHiCtermError contained "\D\i*" endif syn match vimHighlight "\" skipwhite nextgroup=vimHiBang,@vimHighlightCluster -syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster +syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster syn match vimHiGroup contained "\i\+" syn case ignore @@ -688,16 +687,17 @@ syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 -syn cluster vimHiCluster contains=vimGroup,vimHiBlend,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment -syn region vimHiKeyList contained oneline start="\i\+" skip="\\\\\|\\|" end="$\||" contains=@vimHiCluster +syn cluster vimHiCluster contains=vimGroup,vimHiBlend,vimHiGroup,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment +syn region vimHiKeyList contained start="\i\+" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror") syn match vimHiKeyError contained "\i\+="he=e-1 endif syn match vimHiTerm contained "\cterm="he=e-1 nextgroup=vimHiAttribList -syn match vimHiStartStop contained "\c\(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption +syn match vimHiStartStop contained "\c\%(start\|stop\)="he=e-1 nextgroup=vimHiTermcap,vimOption syn match vimHiCTerm contained "\ccterm="he=e-1 nextgroup=vimHiAttribList syn match vimHiCtermFgBg contained "\ccterm[fb]g="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError syn match vimHiCtermul contained "\cctermul="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError +syn match vimHiCtermfont contained "\cctermfont="he=e-1 nextgroup=vimHiNmbr,vimHiCtermColor,vimFgBgAttrib,vimHiCtermError syn match vimHiGui contained "\cgui="he=e-1 nextgroup=vimHiAttribList syn match vimHiGuiFont contained "\cfont="he=e-1 nextgroup=vimHiFontname syn match vimHiGuiFgBg contained "\cgui\%([fb]g\|sp\)="he=e-1 nextgroup=vimHiGroup,vimHiGuiFontname,vimHiGuiRgb,vimFgBgAttrib @@ -706,12 +706,13 @@ syn match vimHiBlend contained "\cblend="he=e-1 nextgroup=vimHiNmbr syn match vimHiNmbr contained '\d\+' " Highlight: clear {{{2 -syn keyword vimHiClear contained clear nextgroup=vimHiGroup +syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup " Highlight: link {{{2 " see tst24 (hi def vs hi) (Jul 06, 2018) "syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\\|\\)" end="$" contains=vimHiGroup,vimGroup,vimHLGroup,vimNotation -syn region vimHiLink contained oneline matchgroup=vimCommand start="\(\\|\\)" end="$" contains=@vimHiCluster +" TODO: simplify and allow line continuations --djk +syn region vimHiLink contained matchgroup=Type start="\%(\\|\\)" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster " Control Characters: {{{2 " ================== @@ -987,7 +988,6 @@ if !exists("skip_vim_syntax_inits") hi def link vimFBVar vimVar hi def link vimFgBgAttrib vimHiAttrib hi def link vimFuncEcho vimCommand - hi def link vimHiCtermul vimHiTerm hi def link vimFold Folded hi def link vimFor vimCommand hi def link vimFTCmd vimCommand @@ -1004,8 +1004,11 @@ if !exists("skip_vim_syntax_inits") hi def link vimHiAttrib PreProc hi def link vimHiBang vimBang hi def link vimHiBlend vimHiTerm - hi def link vimHiClear vimHighlight + hi def link vimHiClear Type + hi def link vimHiCtermColor Constant hi def link vimHiCtermFgBg vimHiTerm + hi def link vimHiCtermfont vimHiTerm + hi def link vimHiCtermul vimHiTerm hi def link vimHiCTerm vimHiTerm hi def link vimHighlight vimCommand hi def link vimHiGroup vimGroupName -- cgit From 37db3d97ea49fd1e22d50dd21e8924ed047cba95 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 20 Mar 2024 07:04:31 +0800 Subject: vim-patch:ec21bafc135a (#27939) runtime(vim): Update base-syntax, disallow '.' at start of menu item names (vim/vim#14232) Disallow '.' at the start of a menu item name. This is the menu path separator character and should be escaped with a '\' in this case. Partially fixes vim/vim#14230. "popup" is still incorrectly matched as the Ex command. https://github.com/vim/vim/commit/ec21bafc135a1e78d40e4fc9118e022bbab958e8 Co-authored-by: dkearns --- runtime/syntax/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 1cd2bdc568..d5761087e0 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -488,8 +488,8 @@ syn keyword vimMenu am[enu] an[oremenu] aun[menu] cme[nu] cnoreme[nu] cunme[nu] syn keyword vimMenu popu[p] skipwhite nextgroup=vimMenuBang,vimMenuName syn region vimMenuRhs contained contains=@vimContinue,vimNotation start="|\@!\S" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" syn region vimMenuRhsContinue contained contains=@vimContinue,vimNotation start=+^\s*\%(\\\|"\\ \)+ skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + end="$" matchgroup=vimSep end="|" -syn match vimMenuName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs -syn match vimMenuName "\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue +syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation skipwhite nextgroup=vimCmdSep,vimMenuRhs +syn match vimMenuName "\.\@!\%(\\\s\|\S\)\+\ze\s*$" contained contains=vimMenuNotation,vimNotation skipwhite skipnl nextgroup=vimCmdSep,vimMenuRhsContinue syn match vimMenuNotation "&\a\|&&\|\\\s\|\\\." contained syn match vimMenuPriority "\<\d\+\%(\.\d\+\)*\>" contained skipwhite nextgroup=vimMenuName syn match vimMenuMod "\c<\%(script\|silent\|special\)>" contained skipwhite nextgroup=vimMenuName,vimMenuPriority,vimMenuMod contains=vimMapModKey,vimMapModErr -- cgit From 15c6909bb198ca8a1a22405a4a7e96357716e57e Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 22 Mar 2024 07:31:43 +0800 Subject: vim-patch:35e6f4ca27c8 (#27973) runtime(vim): Update base-syntax, improve function definition highlighting (vim/vim#14203) Improve function definition highlighting. - Match bang and function modifiers - abort etc. - Only match valid scope modifiers. - Match listing commands. - Don't match ex commands in function names. - Split function syntax groups into :func and :def subgroups. - Match Vim9-script parameter and return types. - Limit legacy-script and Vim9-script comments to :func and :def definitions, respectively. https://github.com/vim/vim/commit/35e6f4ca27c8115c606f265e4b09e11db01c970d Omit the vimFunctionError change as it's a whitespace-only change and will likely be superseded by later patches. Co-authored-by: dkearns --- runtime/syntax/vim.vim | 80 +++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 66 insertions(+), 14 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index d5761087e0..d37c54a63f 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -155,7 +155,7 @@ syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSub syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,@vimEcho,vimExecute,vimIsCommand,vimExtCmd,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimDef,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimGlobal,vimHighlight,vimLet,vimMap,vimMark,vimNotFunc,vimNorm,vimSet,vimSyntax,vimUnlet,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate syn match vimCmdSep "[:|]\+" skipwhite nextgroup=@vimCmdList,vimSubst1 syn match vimIsCommand "\<\%(\h\w*\|[23]mat\%[ch]\)\>" contains=vimCommand syn match vimVar contained "\<\h[a-zA-Z0-9#_]*\>" @@ -215,7 +215,7 @@ syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBan " Operators: {{{2 " ========= -syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimType,vimRegister,@vimContinue,vim9Comment,vimVar +syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,@vimContinue,vim9Comment,vimVar syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile @@ -227,25 +227,67 @@ endif " Functions : Tag is provided for those who wish to highlight tagged functions {{{2 " ========= -syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID -syn cluster vimFuncBodyList contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimContinue,vimCtrlChar,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimLetHereDoc,vimLineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst -syn match vimFunction "\<\(fu\%[nction]\)!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody -syn match vimFunction "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey +syn match vimDef "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimDefKey + +syn match vimFunction "\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams +syn match vimDef "\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams + +syn match vimFuncComment contained +".*+ skipwhite skipnl nextgroup=vimFuncBody,vimEndfunction +syn match vimDefComment contained "#.*" skipwhite skipnl nextgroup=vimDefBody,vimEnddef + +syn match vimFuncBang contained "!" +syn match vimFuncSID contained "\c" +syn match vimFuncSID contained "\<[sg]:" +syn keyword vimFuncKey contained fu[nction] +syn keyword vimDefKey contained def + +syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipnl nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod contains=vimFuncParam,@vimContinue +syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipnl nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType contains=vimDefParam,vim9Comment +syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals +syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals + +syn match vimFuncParamEquals contained "=" skipwhite nextgroup=@vimExprList +syn match vimFuncMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipnl nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod + +syn region vimFuncBody contained start="^" matchgroup=vimCommand end="\" contains=@vimFuncBodyList +syn region vimDefBody contained start="^" matchgroup=vimCommand end="\" contains=@vimDefBodyList + +syn match vimEndfunction "\" +syn match vimEnddef "\" if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' - syn region vimFuncBody contained fold start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList -else - syn region vimFuncBody contained start="\ze\s*(" matchgroup=vimCommand end="\<\(endf\>\|endfu\%[nction]\>\|enddef\>\)" contains=@vimFuncBodyList + syn region vimFuncFold start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\" contains=vimFunction fold keepend transparent + syn region vimFuncFold start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+(" end="\" contains=vimDef fold keepend transparent + syn region vimFuncFold start="\\|\" syn match vimFuncBlank contained "\s\+" syn keyword vimPattern contained start skip end +" Types: {{{2 +" ===== " vimTypes : new for vim9 -syn match vimType ":\s*\zs\<\(bool\|number\|float\|string\|blob\|list<\|dict<\|job\|channel\|func\)\>" +syn region vimReturnType contained start=":\s" end="$" matchgroup=vim9Comment end="\ze#" skipwhite skipnl nextgroup=vimDefBody,vimDefComment,vimEnddef contains=vimTypeSep transparent +syn match vimParamType contained ":\s\+\a" skipwhite skipnl nextgroup=vimFuncParamEquals contains=vimTypeSep,@vimType + +syn match vimTypeSep contained ":\s\@=" skipwhite nextgroup=@vimType +syn keyword vimType contained any blob bool channel float job number string void +syn match vimType contained "\" +syn region vimCompoundType contained matchgroup=vimType start="\" + +syn cluster vimType contains=vimType,vimCompoundType,vimUserType " Keymaps: (Vim Project Addition) {{{2 " ======= @@ -454,7 +496,7 @@ syn case ignore syn keyword vimEchohlNone contained none syn case match -syn cluster vimEcho contains=vimEcho.* +syn cluster vimEcho contains=vimEcho,vimEchohl syn region vimExecute matchgroup=vimCommand start="\" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent @@ -977,11 +1019,16 @@ if !exists("skip_vim_syntax_inits") hi def link vimContinue Special hi def link vimContinueComment vimComment hi def link vimCtrlChar SpecialChar + hi def link vimDefComment vimComment + hi def link vimDefKey vimCommand + hi def link vimDefParam vimVar hi def link vimEcho vimCommand hi def link vimEchohlNone vimGroup hi def link vimEchohl vimCommand hi def link vimElseIfErr Error hi def link vimElseif vimCondHL + hi def link vimEndfunction vimCommand + hi def link vimEnddef vimCommand hi def link vimEnvvar PreProc hi def link vimError Error hi def link vimEscape Special @@ -992,8 +1039,13 @@ if !exists("skip_vim_syntax_inits") hi def link vimFor vimCommand hi def link vimFTCmd vimCommand hi def link vimFTOption vimSynType + hi def link vimFuncBang vimBang + hi def link vimFuncComment vimComment hi def link vimFuncKey vimCommand hi def link vimFuncName Function + hi def link vimFuncMod Special + hi def link vimFuncParam vimVar + hi def link vimFuncParamEquals vimOper hi def link vimFuncSID Special hi def link vimFuncVar Identifier hi def link vimGroupAdd vimSynOption -- cgit From a44ac26c752028d50eaff5d39fadb8115c2ddaa9 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 23 Mar 2024 06:43:25 +0800 Subject: vim-patch:76d62985c1ff (#27985) runtime(vim): Update base-syntax, remove old unused syntax groups. (vim/vim#14146) Remove old unused syntax groups. - vimRegion, vimPattern and vimKeyword removed in Vim 5.3. - vimAuSyntax, vimAutoCmdOpt, vimAutoSet and vimStatement removed in 5.6. The following were linked in :hi commands but never defined with :syn and, most likely, never used: - vimHLMod introduced in 5.0. - vimKeycode and vimKeycodeError introduced in 5.4. - vimElseif introduced in 5.6. - vimFold introduced in 6.4. - vimOperStar (and vimoperStar) introduced in 9.0. https://github.com/vim/vim/commit/76d62985c1ffbd7669ccc628ca43445d14c5aba6 Co-authored-by: dkearns --- runtime/syntax/vim.vim | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index d37c54a63f..640102562b 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -197,7 +197,7 @@ syn keyword vimFTOption contained detect indent off on plugin " 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,vim9Comment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimRegion,vimNotation,vimCtrlChar,vimFuncVar,vimContinue +syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vim9Comment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue syn match vimAugroup "\" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' syn region vimAugroup fold start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd @@ -219,7 +219,7 @@ syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperPa syn match vimOper "||\|&&\|[-+*/%.!]" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\%#=1\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\|!\~#\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile syn match vimOper "\(\" skipwhite nextgroup=vimString,vimSpecFile -syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=vimoperStar,@vimOperGroup +syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup syn region vimOperParen matchgroup=vimSep start="#\={" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror") syn match vimOperError ")" @@ -272,8 +272,6 @@ endif syn match vimFuncVar contained "a:\%(\K\k*\|\d\+\)\>" syn match vimFuncBlank contained "\s\+" -syn keyword vimPattern contained start skip end - " Types: {{{2 " ===== " vimTypes : new for vim9 @@ -292,8 +290,7 @@ syn cluster vimType contains=vimType,vimCompoundType,vimUserType " Keymaps: (Vim Project Addition) {{{2 " ======= -" TODO: autogenerated vimCommand keyword list does not handle all abbreviations -" : handle Vim9 script comments when something like #13104 is merged +" TODO: handle Vim9 script comments when something like #13104 is merged syn match vimKeymapStart "^" contained skipwhite nextgroup=vimKeymapLhs,vimKeymapLineComment syn match vimKeymapLhs "\S\+" contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation syn match vimKeymapRhs "\S\+" contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation @@ -314,7 +311,7 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= -syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegion,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange +syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange syn keyword vimUserCommand contained com[mand] syn match vimUserCmd "\.*$" contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter syn match vimUserAttrbError contained "-\a\+\ze\s" @@ -463,6 +460,7 @@ VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*\%( " For: {{{2 " === syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList + " Abbreviations: {{{2 " ============= " GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs' @@ -616,7 +614,6 @@ if has("conceal") endif syn match vimSyntax "\" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment -syn match vimAuSyntax contained "\s+sy\%[ntax]" contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment syn cluster vimFuncBodyList add=vimSyntax " Syntax: case {{{2 @@ -984,7 +981,6 @@ if !exists("skip_vim_syntax_inits") hi def link vimHiAttribList vimError hi def link vimHiCtermError vimError hi def link vimHiKeyError vimError - hi def link vimKeyCodeError vimError hi def link vimMapModErr vimError hi def link vimSubstFlagErr vimError hi def link vimSynCaseError vimError @@ -997,12 +993,9 @@ if !exists("skip_vim_syntax_inits") hi def link vimAugroupBang vimBang hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand - hi def link vimAuHighlight vimHighlight - hi def link vimAutoCmdOpt vimOption hi def link vimAutoCmd vimCommand hi def link vimAutoEvent Type hi def link vimAutoCmdMod Special - hi def link vimAutoSet vimCommand hi def link vimBang vimOper hi def link vimBehaveBang vimBang hi def link vimBehaveModel vimBehave @@ -1026,7 +1019,6 @@ if !exists("skip_vim_syntax_inits") hi def link vimEchohlNone vimGroup hi def link vimEchohl vimCommand hi def link vimElseIfErr Error - hi def link vimElseif vimCondHL hi def link vimEndfunction vimCommand hi def link vimEnddef vimCommand hi def link vimEnvvar PreProc @@ -1035,7 +1027,6 @@ if !exists("skip_vim_syntax_inits") hi def link vimFBVar vimVar hi def link vimFgBgAttrib vimHiAttrib hi def link vimFuncEcho vimCommand - hi def link vimFold Folded hi def link vimFor vimCommand hi def link vimFTCmd vimCommand hi def link vimFTOption vimSynType @@ -1072,13 +1063,10 @@ if !exists("skip_vim_syntax_inits") hi def link vimHiStartStop vimHiTerm hi def link vimHiTerm Type hi def link vimHLGroup vimGroup - hi def link vimHLMod PreProc hi def link vimInsert vimString hi def link vimIskSep Delimiter - hi def link vimKeyCode vimSpecFile hi def link vimKeymapLineComment vimComment hi def link vimKeymapTailComment vimComment - hi def link vimKeyword Statement hi def link vimLet vimCommand hi def link vimLetHereDoc vimString hi def link vimLetHereDocStart Special @@ -1109,7 +1097,6 @@ if !exists("skip_vim_syntax_inits") hi def link vimNumber Number hi def link vimOperError Error hi def link vimOper Operator - hi def link vimOperStar vimOper hi def link vimOption PreProc hi def link vimParenSep Delimiter hi def link vimPatSepErr vimError @@ -1131,7 +1118,6 @@ if !exists("skip_vim_syntax_inits") hi def link vimSpecFile Identifier hi def link vimSpecFileMod vimSpecFile hi def link vimSpecial Type - hi def link vimStatement Statement hi def link vimStringCont vimString hi def link vimString String hi def link vimStringEnd vimString -- cgit From 31a15fb2a1878ae8acd3f9140cf40a0b09235071 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Mar 2024 10:10:57 +0100 Subject: vim-patch:3e72bf10a0a2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit runtime(java): Recognise the {@snippet} documentation tag (vim/vim#14271) Remember that ‘code fragments are typically Java source code, but they may also be fragments of properties files, source code in other languages, or plain text.’ Therefore, with these changes, markup tags are highlighted in the Java source files (as external snippets) and in the {@snippet} tags. Also: - Improve matching of the multi-line {@code} documentation tag with any contained balanced braces. - Recognise the {@literal} documentation tag. - Highlight stray blanks in comments. Related to an enhancement proposal for PCRE-like callouts discussed at https://github.com/vim/vim/issues/11217. References: https://openjdk.org/jeps/413 https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html https://github.com/vim/vim/commit/3e72bf10a0a2fc34f01ff9663ed3324c2a140228 Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com> --- runtime/syntax/java.vim | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index c059de603c..fe0cabf58e 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2024 Mar 06 +" Last Change: 2024 Mar 22 " Please check :help java.vim for comments on some of the options available. @@ -191,10 +191,14 @@ if exists("java_comment_strings") syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber,javaStrTempl endif -syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,@Spell +syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,javaSpaceError,@Spell syn match javaCommentStar contained "^\s*\*[^/]"me=e-1 syn match javaCommentStar contained "^\s*\*$" -syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,@Spell +syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,javaCommentMarkupTag,javaSpaceError,@Spell +syn match javaCommentMarkupTag contained "@\%(end\|highlight\|link\|replace\|start\)\>" nextgroup=javaCommentMarkupTagAttr skipwhite +syn match javaCommentMarkupTagAttr contained "\" nextgroup=javaCommentMarkupTagAttr skipwhite +syn region javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr skipwhite oneline +hi def link javaCommentMarkupTagAttr htmlArg hi def link javaCommentString javaString hi def link javaComment2String javaString hi def link javaCommentCharacter javaCharacter @@ -211,15 +215,19 @@ if !exists("java_ignore_javadoc") && main_syntax != 'jsp' " here. syntax spell default - syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaTodo,@Spell - syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,@Spell,javaDocTags,javaDocSeeTag - - syn region javaDocTags contained start="{@\(code\|link\|linkplain\|inherit[Dd]oc\|doc[rR]oot\|value\)" end="}" + syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag,javaTodo,javaSpaceError,@Spell + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag + syn region javaDocTags contained start="{@\%(li\%(teral\|nk\%(plain\)\=\)\|inherit[Dd]oc\|doc[rR]oot\|value\)\>" end="}" syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam syn match javaDocParam contained "\s\S\+" syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>" syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam syn match javaDocSeeTagParam contained @"\_[^"]\+"\|\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend + syn region javaCodeSkipBlock contained transparent start="{\%(@code\>\)\@!" end="}" contains=javaCodeSkipBlock,javaDocCodeTag + syn region javaDocCodeTag contained start="{@code\>" end="}" contains=javaDocCodeTag,javaCodeSkipBlock + syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl + syn region javaSnippetSkipBlock contained transparent start="{\%(@snippet\>\)\@!" end="}" contains=javaSnippetSkipBlock,javaDocSnippetTag,javaCommentMarkupTag + syn region javaDocSnippetTag contained start="{@snippet\>" end="}" contains=javaDocSnippetTag,javaSnippetSkipBlock,javaDocSnippetTagAttr,javaCommentMarkupTag syntax case match endif @@ -404,6 +412,8 @@ hi def link javaAnnotation PreProc hi def link javaCommentTitle SpecialComment hi def link javaDocTags Special +hi def link javaDocCodeTag Special +hi def link javaDocSnippetTag Special hi def link javaDocParam Function hi def link javaDocSeeTagParam Function hi def link javaCommentStar javaComment @@ -413,6 +423,8 @@ hi def link javaExternal Include hi def link htmlComment Special hi def link htmlCommentPart Special +hi def link htmlArg Type +hi def link htmlString String hi def link javaSpaceError Error if s:isModuleInfoDeclarationCurrentBuffer() -- cgit From 31c4cb23473a6e3a19a7986fae25c5bfc03b4eda Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 25 Mar 2024 19:03:26 +0100 Subject: vim-patch:8e59a7ba8877 runtime(java): Recognise the inline kind of the {@return} tag (vim/vim#14284) Also: - Refine comment matching (javaComment{Error\ and,Start}). - Continue rewriting regexps (prefer atom grouping with non-capturing parens; factor out common prefixes in alternations). - Allow for relative paths with the _file_ attribute of {@snippet}. - Anticipate HTML in the @see tags. - Match the nullary method parens in javaDocSeeTagParam. - Improve the boundary patterns for summary sentences of documentation. > This sentence ends at ... or at the first tag (as defined > below). There are Java documentation tags (@) and there are HTML tags () (with Markdown looming large; see JEP 467). With block tags, e.g. @param, @return, @see, we begin another documentation "sentence" whether or not the author has terminated the summary sentence with a period; with ., we may follow abbreviations, enumerations, initials, (but instead consider @literal or  ) _within_ the summary sentence. On the other hand, inline tags, e.g. @code, @link, @literal, should not terminate the summary sentence. References: https://bugs.openjdk.org/browse/JDK-8075778 https://www.oracle.com/technical-resources/articles/java/javadoc-tool.html#firstsentence https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html https://github.com/vim/vim/commit/8e59a7ba88776d5425bafc6eefd978de3312fcdf Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com> --- runtime/syntax/java.vim | 37 ++++++++++++++++++++++++------------- 1 file changed, 24 insertions(+), 13 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index fe0cabf58e..cf27e0dc91 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2024 Mar 22 +" Last Change: 2024 Mar 24 " Please check :help java.vim for comments on some of the options available. @@ -191,17 +191,20 @@ if exists("java_comment_strings") syn cluster javaCommentSpecial2 add=javaComment2String,javaCommentCharacter,javaNumber,javaStrTempl endif -syn region javaComment start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,javaSpaceError,@Spell +syn region javaComment matchgroup=javaCommentStart start="/\*" end="\*/" contains=@javaCommentSpecial,javaTodo,javaCommentError,javaSpaceError,@Spell syn match javaCommentStar contained "^\s*\*[^/]"me=e-1 syn match javaCommentStar contained "^\s*\*$" syn match javaLineComment "//.*" contains=@javaCommentSpecial2,javaTodo,javaCommentMarkupTag,javaSpaceError,@Spell -syn match javaCommentMarkupTag contained "@\%(end\|highlight\|link\|replace\|start\)\>" nextgroup=javaCommentMarkupTagAttr skipwhite -syn match javaCommentMarkupTagAttr contained "\" nextgroup=javaCommentMarkupTagAttr skipwhite -syn region javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr skipwhite oneline +syn match javaCommentMarkupTag contained "@\%(end\|highlight\|link\|replace\|start\)\>" nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite +syn match javaCommentMarkupTagAttr contained "\" nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite +syn region javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite oneline hi def link javaCommentMarkupTagAttr htmlArg hi def link javaCommentString javaString hi def link javaComment2String javaString hi def link javaCommentCharacter javaCharacter +syn match javaCommentError contained "/\*"me=e-1 display +hi def link javaCommentError javaError +hi def link javaCommentStart javaComment syn cluster javaTop add=javaComment,javaLineComment @@ -215,17 +218,18 @@ if !exists("java_ignore_javadoc") && main_syntax != 'jsp' " here. syntax spell default - syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag,javaTodo,javaSpaceError,@Spell - syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle keepend end="\.$" end="\.[ \t\r<&]"me=e-1 end="[^{]@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag + syn region javaDocComment start="/\*\*" end="\*/" keepend contains=javaCommentTitle,@javaHtml,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag,javaTodo,javaCommentError,javaSpaceError,@Spell + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*" matchgroup=javaCommentTitle end="\.$" end="\.[ \t\r]\@=" end="\%(^\s*\**\s*\)\@<=@"me=s-2,he=s-1 end="\*/"me=s-1,he=s-1 contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag + syn region javaCommentTitle contained matchgroup=javaDocComment start="/\*\*\s*\r\=\n\=\s*\**\s*\%({@return\>\)\@=" matchgroup=javaCommentTitle end="}\%(\s*\.*\)*" contains=@javaHtml,javaCommentStar,javaTodo,javaCommentError,javaSpaceError,@Spell,javaDocTags,javaDocSeeTag,javaDocCodeTag,javaDocSnippetTag syn region javaDocTags contained start="{@\%(li\%(teral\|nk\%(plain\)\=\)\|inherit[Dd]oc\|doc[rR]oot\|value\)\>" end="}" - syn match javaDocTags contained "@\(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam - syn match javaDocParam contained "\s\S\+" - syn match javaDocTags contained "@\(version\|author\|return\|deprecated\|serial\|serialField\|serialData\)\>" - syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam - syn match javaDocSeeTagParam contained @"\_[^"]\+"\|\|\(\k\|\.\)*\(#\k\+\((\_[^)]\+)\)\=\)\=@ extend + syn match javaDocTags contained "@\%(param\|exception\|throws\|since\)\s\+\S\+" contains=javaDocParam + syn match javaDocParam contained "\s\S\+" + syn match javaDocTags contained "@\%(version\|author\|return\|deprecated\|serial\%(Field\|Data\)\=\)\>" + syn region javaDocSeeTag contained matchgroup=javaDocTags start="@see\s\+" matchgroup=NONE end="\_."re=e-1 contains=javaDocSeeTagParam + syn match javaDocSeeTagParam contained @"\_[^"]\+"\|\|\%(\k\|\.\)*\%(#\k\+\%((\_[^)]*)\)\=\)\=@ contains=@javaHtml extend syn region javaCodeSkipBlock contained transparent start="{\%(@code\>\)\@!" end="}" contains=javaCodeSkipBlock,javaDocCodeTag syn region javaDocCodeTag contained start="{@code\>" end="}" contains=javaDocCodeTag,javaCodeSkipBlock - syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl + syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.\\/-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl syn region javaSnippetSkipBlock contained transparent start="{\%(@snippet\>\)\@!" end="}" contains=javaSnippetSkipBlock,javaDocSnippetTag,javaCommentMarkupTag syn region javaDocSnippetTag contained start="{@snippet\>" end="}" contains=javaDocSnippetTag,javaSnippetSkipBlock,javaDocSnippetTagAttr,javaCommentMarkupTag syntax case match @@ -367,6 +371,13 @@ endif if !exists("java_minlines") let java_minlines = 10 endif + +" Note that variations of a /*/ balanced comment, e.g., /*/*/, /*//*/, +" /* /*/, /* /*/, etc., may have their rightmost /*/ part accepted +" as a comment start by ':syntax sync ccomment'; consider alternatives +" to make synchronisation start further towards file's beginning by +" bumping up g:java_minlines or issuing ':syntax sync fromstart' or +" preferring &foldmethod set to 'syntax'. exec "syn sync ccomment javaComment minlines=" . java_minlines " The default highlighting. -- cgit From 3587377cdae300f5568151a822e777bbbf184643 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Tue, 26 Mar 2024 18:26:07 +0100 Subject: vim-patch:63d68c2c218e runtime(java): Update java[CR]_JavaLang type lists (vim/vim#14297) - Add to the list of java.lang runtime exceptions two new types: MatchException (Pattern Matching for _switch_) and WrongThreadException (Virtual Threads). - "Demote" Compiler (removed in JDK 21) from the list of java.lang class types to a new list javaLangDeprecated. References: https://bugs.openjdk.org/browse/JDK-8205129 https://bugs.openjdk.org/browse/JDK-8282274 https://bugs.openjdk.org/browse/JDK-8284161 https://github.com/vim/vim/commit/63d68c2c218eeb80c164e1c56c53f51a9e92a5eb Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com> --- runtime/syntax/java.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index cf27e0dc91..1f0c158031 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2024 Mar 24 +" Last Change: 2024 Mar 25 " Please check :help java.vim for comments on some of the options available. @@ -91,7 +91,7 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja " keywords can be pre-sorted and appended without disturbing " the current keyword placement. The below _match_es follow suit. - syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException + syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException WrongThreadException MatchException syn cluster javaTop add=javaR_JavaLang syn cluster javaClasses add=javaR_JavaLang hi def link javaR_JavaLang javaR_Java @@ -111,6 +111,8 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja syn match javaC_JavaLang "\%(\" syn keyword javaC_JavaLang Boolean Character Class ClassLoader Compiler Double Float Integer Long Math Number Object Process Runtime SecurityManager String StringBuffer Thread ThreadGroup Byte Short Void InheritableThreadLocal Package RuntimePermission ThreadLocal StrictMath StackTraceElement Enum ProcessBuilder StringBuilder ClassValue Module ModuleLayer StackWalker Record syn match javaC_JavaLang "\" " See javaDebug. + " As of Java 21, java.lang.Compiler is no more (deprecated in Java 9). + syn keyword javaLangDeprecated Compiler syn cluster javaTop add=javaC_JavaLang syn cluster javaClasses add=javaC_JavaLang hi def link javaC_JavaLang javaC_Java -- cgit From 19b443251fe0405628a0aa90583e6c6512dd0fd0 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 28 Mar 2024 10:00:29 +0100 Subject: vim-patch:677cd956810e runtime(debcontrol): add Static-Built-Using field (vim/vim#14306) https://github.com/vim/vim/commit/677cd956810e685e820a5ade5aa6c29be5044e9b Co-authored-by: Guilherme Puida --- runtime/syntax/debcontrol.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/debcontrol.vim b/runtime/syntax/debcontrol.vim index b173a7b3f7..ea82d85b03 100644 --- a/runtime/syntax/debcontrol.vim +++ b/runtime/syntax/debcontrol.vim @@ -3,7 +3,7 @@ " Maintainer: Debian Vim Maintainers " Former Maintainers: Gerfried Fuchs " Wichert Akkerman -" Last Change: 2023 Dec 22 +" Last Change: 2024 Mar 26 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/debcontrol.vim " Standard syntax initialization @@ -93,7 +93,7 @@ syn case ignore " Catch-all for the legal fields syn region debcontrolField matchgroup=debcontrolKey start="^\%(\%(XSBC-Original-\)\=Maintainer\|Standards-Version\|Bugs\|Origin\|X[SB]-Python-Version\|\%(XS-\)\=Vcs-Mtn\|\%(XS-\)\=Testsuite\%(-Triggers\)\=\|Build-Profiles\|Tag\|Subarchitecture\|Kernel-Version\|Installer-Menu-Item\): " end="$" contains=debcontrolVariable,debcontrolEmail oneline -syn region debcontrolMultiField matchgroup=debcontrolKey start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\): *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment +syn region debcontrolMultiField matchgroup=debcontrolKey start="^\%(Build-\%(Conflicts\|Depends\)\%(-Arch\|-Indep\)\=\|\%(Pre-\)\=Depends\|Recommends\|Suggests\|Breaks\|Enhances\|Replaces\|Conflicts\|Provides\|Built-Using\|Static-Built-Using\|Uploaders\|X[SBC]\{0,3\}\%(Private-\)\=-[-a-zA-Z0-9]\+\): *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment syn region debcontrolMultiFieldSpell matchgroup=debcontrolKey start="^Description: *" skip="^[ \t]" end="^$"me=s-1 end="^[^ \t#]"me=s-1 contains=debcontrolEmail,debcontrolVariable,debcontrolComment,@Spell " Fields for which we do strict syntax checking -- cgit From 2dea0ea82001d7c3f1256dfcec25cc10c17d45e5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 28 Mar 2024 10:16:13 +0100 Subject: vim-patch:b2e1fee72c45 runtime(haskell): allow TODO keywords in comments closes: vim/vim#14319 https://github.com/vim/vim/commit/b2e1fee72c456bdb2f14bd12e4c06887743ae3a2 Co-authored-by: Enrico Maria De Angelis --- runtime/syntax/haskell.vim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/haskell.vim b/runtime/syntax/haskell.vim index b48b278084..509aa25122 100644 --- a/runtime/syntax/haskell.vim +++ b/runtime/syntax/haskell.vim @@ -1,7 +1,7 @@ " Vim syntax file " Language: Haskell " Maintainer: Haskell Cafe mailinglist -" Last Change: 2020 Oct 4 by Marcin Szamotulski +" Last Change: 2024 Mar 28 by Enrico Maria De Angelis " Original Author: John Williams " " Thanks to Ryan Crumley for suggestions and John Meacham for @@ -104,8 +104,8 @@ endif " Comments -syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=@Spell -syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment,@Spell +syn match hsLineComment "---*\([^-!#$%&\*\+./<=>\?@\\^|~].*\)\?$" contains=hsTodo,@Spell +syn region hsBlockComment start="{-" end="-}" contains=hsBlockComment,hsTodo,@Spell syn region hsPragma start="{-#" end="#-}" syn keyword hsTodo contained FIXME TODO XXX NOTE @@ -164,6 +164,7 @@ hi def link hsLiterateComment hsComment hi def link hsBlockComment hsComment hi def link hsLineComment hsComment hi def link hsComment Comment +hi def link hsTodo Todo hi def link hsPragma SpecialComment hi def link hsBoolean Boolean hi def link hsType Type -- cgit From c804d7968bb54eaac240e879346e7ad55a03b77b Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 28 Mar 2024 18:08:05 +0800 Subject: vim-patch:982e191b38b4 (#28073) runtime(vim): Update base-syntax, match empty blob and :abclear modifiers (vim/vim#14318) - Match empty blob literals. - Match modifier arguments to :abclear commands. https://github.com/vim/vim/commit/982e191b38b493d148d73871a724381214e4c62f Co-authored-by: dkearns --- runtime/syntax/vim.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'runtime/syntax') diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 640102562b..e665ec8e14 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -150,6 +150,7 @@ syn match vimNumber '\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\=' skipwhite nextgroup= syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment +syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment syn match vimNumber '\%(^\|\A\)\zs#\x\{6}' skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment syn case match @@ -465,6 +466,8 @@ syn keyword vimFor for skipwhite nextgroup=vimVar,vimVarList " ============= " GEN_SYN_VIM: vimCommand abbrev, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod,vimMapLhs' syn keyword vimAbb ab[breviate] ca[bbrev] cnorea[bbrev] cuna[bbrev] ia[bbrev] inorea[bbrev] iuna[bbrev] norea[bbrev] una[bbreviate] skipwhite nextgroup=vimMapMod,vimMapLhs +" GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod' +syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod " Autocmd: {{{2 " ======= -- cgit From 20dd60f13ca6f2746f737233f194c7d11c0af2a5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 31 Mar 2024 22:57:26 +0200 Subject: vim-patch:cbb92b5ceb6a runtime(sshconfig,sshdconfig): update syntax (vim/vim#14351) * fix case insensitivity of Host and Hostname keys * improve regexps * add keywords https://github.com/vim/vim/commit/cbb92b5ceb6a8169b6eddceec3837aac02f21e3b Co-authored-by: Eisuke Kawashima --- runtime/syntax/sshconfig.vim | 62 +++++++++++++++++++++++-------------------- runtime/syntax/sshdconfig.vim | 55 ++++++++++++++++++-------------------- 2 files changed, 59 insertions(+), 58 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/sshconfig.vim b/runtime/syntax/sshconfig.vim index 750289d83e..99e10fd1ee 100644 --- a/runtime/syntax/sshconfig.vim +++ b/runtime/syntax/sshconfig.vim @@ -63,8 +63,7 @@ syn keyword sshconfigMAC hmac-sha2-256 syn keyword sshconfigMAC hmac-sha2-512 syn keyword sshconfigMAC hmac-md5 syn keyword sshconfigMAC hmac-md5-96 -syn keyword sshconfigMAC hmac-ripemd160 -syn match sshconfigMAC "\" +syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" syn match sshconfigMAC "\" @@ -107,33 +106,35 @@ syn keyword sshconfigSysLogFacility DAEMON USER AUTH AUTHPRIV LOCAL0 LOCAL1 syn keyword sshconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7 syn keyword sshconfigAddressFamily inet inet6 -syn match sshconfigIPQoS "af1[123]" -syn match sshconfigIPQoS "af2[123]" -syn match sshconfigIPQoS "af3[123]" -syn match sshconfigIPQoS "af4[123]" -syn match sshconfigIPQoS "cs[0-7]" -syn keyword sshconfigIPQoS ef lowdelay throughput reliability +syn match sshconfigIPQoS "\" +syn match sshconfigIPQoS "\" +syn keyword sshconfigIPQoS ef le lowdelay throughput reliability syn keyword sshconfigKbdInteractive bsdauth pam skey syn keyword sshconfigKexAlgo diffie-hellman-group1-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group14-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha1 syn keyword sshconfigKexAlgo diffie-hellman-group-exchange-sha256 +syn keyword sshconfigKexAlgo diffie-hellman-group16-sha512 +syn keyword sshconfigKexAlgo diffie-hellman-group18-sha512 +syn keyword sshconfigKexAlgo diffie-hellman-group14-sha256 syn keyword sshconfigKexAlgo ecdh-sha2-nistp256 syn keyword sshconfigKexAlgo ecdh-sha2-nistp384 syn keyword sshconfigKexAlgo ecdh-sha2-nistp521 -syn match sshconfigKexAlgo "\" +syn match sshconfigKexAlgo "\" +syn match sshconfigKexAlgo "\" syn keyword sshconfigTunnel point-to-point ethernet -syn match sshconfigVar "%[rhplLdun]\>" +syn match sshconfigVar "%[CdfHhIijKkLlnprTtu]\>" +syn match sshconfigVar "%%" syn match sshconfigSpecial "[*?]" -syn match sshconfigNumber "\d\+" +syn match sshconfigNumber "\<\d\+\>" syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>" syn match sshconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>" syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>" -syn match sshconfigHostPort "\(Host \)\@<=.\+" -syn match sshconfigHostPort "\(HostName \)\@<=.\+" +syn match sshconfigHostPort "\<\c\(Host \+\)\@<=.\+" +syn match sshconfigHostPort "\<\c\(Hostname \+\)\@<=.\+" " case off syn case ignore @@ -142,10 +143,10 @@ syn case ignore " Keywords syn keyword sshconfigHostSect Host -syn keyword sshconfigMatch canonical final exec host originalhost user localuser all +syn keyword sshconfigMatch canonical final exec localnetwork host originalhost tagged user localuser all -syn keyword sshconfigKeyword AddressFamily syn keyword sshconfigKeyword AddKeysToAgent +syn keyword sshconfigKeyword AddressFamily syn keyword sshconfigKeyword BatchMode syn keyword sshconfigKeyword BindAddress syn keyword sshconfigKeyword BindInterface @@ -157,16 +158,18 @@ syn keyword sshconfigKeyword CanonicalizePermittedCNAMEs syn keyword sshconfigKeyword CASignatureAlgorithms syn keyword sshconfigKeyword CertificateFile syn keyword sshconfigKeyword ChallengeResponseAuthentication +syn keyword sshconfigKeyword ChannelTimeout syn keyword sshconfigKeyword CheckHostIP syn keyword sshconfigKeyword Ciphers syn keyword sshconfigKeyword ClearAllForwardings syn keyword sshconfigKeyword Compression -syn keyword sshconfigKeyword ConnectTimeout syn keyword sshconfigKeyword ConnectionAttempts +syn keyword sshconfigKeyword ConnectTimeout syn keyword sshconfigKeyword ControlMaster syn keyword sshconfigKeyword ControlPath syn keyword sshconfigKeyword ControlPersist syn keyword sshconfigKeyword DynamicForward +syn keyword sshconfigKeyword EnableEscapeCommandline syn keyword sshconfigKeyword EnableSSHKeysign syn keyword sshconfigKeyword EscapeChar syn keyword sshconfigKeyword ExitOnForwardFailure @@ -176,18 +179,17 @@ syn keyword sshconfigKeyword ForwardAgent syn keyword sshconfigKeyword ForwardX11 syn keyword sshconfigKeyword ForwardX11Timeout syn keyword sshconfigKeyword ForwardX11Trusted -syn keyword sshconfigKeyword GSSAPIAuthentication -syn keyword sshconfigKeyword GSSAPIDelegateCredentials syn keyword sshconfigKeyword GatewayPorts syn keyword sshconfigKeyword GlobalKnownHostsFile +syn keyword sshconfigKeyword GSSAPIAuthentication +syn keyword sshconfigKeyword GSSAPIDelegateCredentials syn keyword sshconfigKeyword HashKnownHosts -syn keyword sshconfigKeyword HostKeyAlgorithms -syn keyword sshconfigKeyword HostKeyAlias -syn keyword sshconfigKeyword HostName -syn keyword sshconfigKeyword HostbasedAuthentication syn keyword sshconfigKeyword HostbasedAcceptedAlgorithms +syn keyword sshconfigKeyword HostbasedAuthentication syn keyword sshconfigKeyword HostbasedKeyTypes -syn keyword sshconfigKeyword IPQoS +syn keyword sshconfigKeyword HostKeyAlgorithms +syn keyword sshconfigKeyword HostKeyAlias +syn keyword sshconfigKeyword Hostname syn keyword sshconfigKeyword IdentitiesOnly syn keyword sshconfigKeyword IdentityAgent syn keyword sshconfigKeyword IdentityFile @@ -206,15 +208,16 @@ syn keyword sshconfigKeyword MACs syn keyword sshconfigKeyword Match syn keyword sshconfigKeyword NoHostAuthenticationForLocalhost syn keyword sshconfigKeyword NumberOfPasswordPrompts -syn keyword sshconfigKeyword PKCS11Provider +syn keyword sshconfigKeyword ObscureKeystrokeTiming syn keyword sshconfigKeyword PasswordAuthentication syn keyword sshconfigKeyword PermitLocalCommand syn keyword sshconfigKeyword PermitRemoteOpen +syn keyword sshconfigKeyword PKCS11Provider syn keyword sshconfigKeyword Port syn keyword sshconfigKeyword PreferredAuthentications syn keyword sshconfigKeyword ProxyCommand syn keyword sshconfigKeyword ProxyJump -syn keyword sshconfigKeyword ProxyUseFDPass +syn keyword sshconfigKeyword ProxyUseFdpass syn keyword sshconfigKeyword PubkeyAcceptedAlgorithms syn keyword sshconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshconfigKeyword PubkeyAuthentication @@ -229,18 +232,19 @@ syn keyword sshconfigKeyword SendEnv syn keyword sshconfigKeyword ServerAliveCountMax syn keyword sshconfigKeyword ServerAliveInterval syn keyword sshconfigKeyword SessionType -syn keyword sshconfigKeyword SmartcardDevice syn keyword sshconfigKeyword SetEnv +syn keyword sshconfigKeyword SmartcardDevice syn keyword sshconfigKeyword StdinNull syn keyword sshconfigKeyword StreamLocalBindMask syn keyword sshconfigKeyword StreamLocalBindUnlink syn keyword sshconfigKeyword StrictHostKeyChecking syn keyword sshconfigKeyword SyslogFacility +syn keyword sshconfigKeyword Tag syn keyword sshconfigKeyword TCPKeepAlive syn keyword sshconfigKeyword Tunnel syn keyword sshconfigKeyword TunnelDevice -syn keyword sshconfigKeyword UseBlacklistedKeys syn keyword sshconfigKeyword UpdateHostKeys +syn keyword sshconfigKeyword UseBlacklistedKeys syn keyword sshconfigKeyword User syn keyword sshconfigKeyword UserKnownHostsFile syn keyword sshconfigKeyword VerifyHostKeyDNS @@ -268,9 +272,9 @@ syn keyword sshconfigDeprecated UsePrivilegedPort hi def link sshconfigComment Comment hi def link sshconfigTodo Todo hi def link sshconfigHostPort sshconfigConstant -hi def link sshconfigNumber sshconfigConstant +hi def link sshconfigNumber Number hi def link sshconfigConstant Constant -hi def link sshconfigYesNo sshconfigEnum +hi def link sshconfigYesNo Boolean hi def link sshconfigCipher sshconfigDeprecated hi def link sshconfigCiphers sshconfigEnum hi def link sshconfigMAC sshconfigEnum diff --git a/runtime/syntax/sshdconfig.vim b/runtime/syntax/sshdconfig.vim index c0d9c3f598..8b539d907b 100644 --- a/runtime/syntax/sshdconfig.vim +++ b/runtime/syntax/sshdconfig.vim @@ -64,8 +64,7 @@ syn keyword sshdconfigMAC hmac-sha2-256 syn keyword sshdconfigMAC hmac-sha2-512 syn keyword sshdconfigMAC hmac-md5 syn keyword sshdconfigMAC hmac-md5-96 -syn keyword sshdconfigMAC hmac-ripemd160 -syn match sshdconfigMAC "\" +syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" syn match sshdconfigMAC "\" @@ -108,12 +107,9 @@ syn keyword sshdconfigSysLogFacility LOCAL2 LOCAL3 LOCAL4 LOCAL5 LOCAL6 LOCAL7 syn keyword sshdconfigCompression delayed -syn match sshdconfigIPQoS "af1[123]" -syn match sshdconfigIPQoS "af2[123]" -syn match sshdconfigIPQoS "af3[123]" -syn match sshdconfigIPQoS "af4[123]" -syn match sshdconfigIPQoS "cs[0-7]" -syn keyword sshdconfigIPQoS ef lowdelay throughput reliability +syn match sshdconfigIPQoS "\" +syn match sshdconfigIPQoS "\" +syn keyword sshdconfigIPQoS ef le lowdelay throughput reliability syn keyword sshdconfigKexAlgo diffie-hellman-group1-sha1 syn keyword sshdconfigKexAlgo diffie-hellman-group14-sha1 @@ -125,20 +121,20 @@ syn keyword sshdconfigKexAlgo diffie-hellman-group-exchange-sha256 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp256 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp384 syn keyword sshdconfigKexAlgo ecdh-sha2-nistp521 -syn keyword sshdconfigKexAlgo curve25519-sha256 -syn match sshdconfigKexAlgo "\" +syn match sshdconfigKexAlgo "\" syn match sshdconfigKexAlgo "\" +syn match sshdconfigKexAlgo "\" syn keyword sshdconfigTunnel point-to-point ethernet syn keyword sshdconfigSubsystem internal-sftp -syn match sshdconfigVar "%[hu]\>" +syn match sshdconfigVar "%[CDFfhiKksTtUu]\>" syn match sshdconfigVar "%%" syn match sshdconfigSpecial "[*?]" -syn match sshdconfigNumber "\d\+" +syn match sshdconfigNumber "\<\d\+\>" syn match sshdconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>" syn match sshdconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>" " FIXME: this matches quite a few things which are NOT valid IPv6 addresses @@ -162,15 +158,16 @@ syn keyword sshdconfigKeyword AllowStreamLocalForwarding syn keyword sshdconfigKeyword AllowTcpForwarding syn keyword sshdconfigKeyword AllowUsers syn keyword sshdconfigKeyword AuthenticationMethods -syn keyword sshdconfigKeyword AuthorizedKeysFile syn keyword sshdconfigKeyword AuthorizedKeysCommand syn keyword sshdconfigKeyword AuthorizedKeysCommandUser +syn keyword sshdconfigKeyword AuthorizedKeysFile syn keyword sshdconfigKeyword AuthorizedPrincipalsCommand syn keyword sshdconfigKeyword AuthorizedPrincipalsCommandUser syn keyword sshdconfigKeyword AuthorizedPrincipalsFile syn keyword sshdconfigKeyword Banner syn keyword sshdconfigKeyword CASignatureAlgorithms syn keyword sshdconfigKeyword ChallengeResponseAuthentication +syn keyword sshdconfigKeyword ChannelTimeout syn keyword sshdconfigKeyword ChrootDirectory syn keyword sshdconfigKeyword Ciphers syn keyword sshdconfigKeyword ClientAliveCountMax @@ -187,22 +184,22 @@ syn keyword sshdconfigKeyword GatewayPorts syn keyword sshdconfigKeyword GSSAPIAuthentication syn keyword sshdconfigKeyword GSSAPICleanupCredentials syn keyword sshdconfigKeyword GSSAPIEnablek5users -syn keyword sshdconfigKeyword GSSAPIKeyExchange syn keyword sshdconfigKeyword GSSAPIKexAlgorithms +syn keyword sshdconfigKeyword GSSAPIKeyExchange syn keyword sshdconfigKeyword GSSAPIStoreCredentialsOnRekey syn keyword sshdconfigKeyword GSSAPIStrictAcceptorCheck -syn keyword sshdconfigKeyword HostCertificate -syn keyword sshdconfigKeyword HostKey -syn keyword sshdconfigKeyword HostKeyAgent -syn keyword sshdconfigKeyword HostKeyAlgorithms syn keyword sshdconfigKeyword HostbasedAcceptedAlgorithms syn keyword sshdconfigKeyword HostbasedAcceptedKeyTypes syn keyword sshdconfigKeyword HostbasedAuthentication syn keyword sshdconfigKeyword HostbasedUsesNameFromPacketOnly -syn keyword sshdconfigKeyword IPQoS +syn keyword sshdconfigKeyword HostCertificate +syn keyword sshdconfigKeyword HostKey +syn keyword sshdconfigKeyword HostKeyAgent +syn keyword sshdconfigKeyword HostKeyAlgorithms syn keyword sshdconfigKeyword IgnoreRhosts syn keyword sshdconfigKeyword IgnoreUserKnownHosts syn keyword sshdconfigKeyword Include +syn keyword sshdconfigKeyword IPQoS syn keyword sshdconfigKeyword KbdInteractiveAuthentication syn keyword sshdconfigKeyword KerberosAuthentication syn keyword sshdconfigKeyword KerberosGetAFSToken @@ -213,9 +210,9 @@ syn keyword sshdconfigKeyword KerberosUseKuserok syn keyword sshdconfigKeyword KexAlgorithms syn keyword sshdconfigKeyword KeyRegenerationInterval syn keyword sshdconfigKeyword ListenAddress +syn keyword sshdconfigKeyword LoginGraceTime syn keyword sshdconfigKeyword LogLevel syn keyword sshdconfigKeyword LogVerbose -syn keyword sshdconfigKeyword LoginGraceTime syn keyword sshdconfigKeyword MACs syn keyword sshdconfigKeyword Match syn keyword sshdconfigKeyword MaxAuthTries @@ -223,8 +220,6 @@ syn keyword sshdconfigKeyword MaxSessions syn keyword sshdconfigKeyword MaxStartups syn keyword sshdconfigKeyword ModuliFile syn keyword sshdconfigKeyword PasswordAuthentication -syn keyword sshdconfigKeyword PerSourceMaxStartups -syn keyword sshdconfigKeyword PerSourceNetBlockSize syn keyword sshdconfigKeyword PermitBlacklistedKeys syn keyword sshdconfigKeyword PermitEmptyPasswords syn keyword sshdconfigKeyword PermitListen @@ -234,6 +229,8 @@ syn keyword sshdconfigKeyword PermitTTY syn keyword sshdconfigKeyword PermitTunnel syn keyword sshdconfigKeyword PermitUserEnvironment syn keyword sshdconfigKeyword PermitUserRC +syn keyword sshdconfigKeyword PerSourceMaxStartups +syn keyword sshdconfigKeyword PerSourceNetBlockSize syn keyword sshdconfigKeyword PidFile syn keyword sshdconfigKeyword Port syn keyword sshdconfigKeyword PrintLastLog @@ -243,23 +240,24 @@ syn keyword sshdconfigKeyword PubkeyAcceptedAlgorithms syn keyword sshdconfigKeyword PubkeyAcceptedKeyTypes syn keyword sshdconfigKeyword PubkeyAuthentication syn keyword sshdconfigKeyword PubkeyAuthOptions -syn keyword sshdconfigKeyword RSAAuthentication +syn keyword sshdconfigKeyword RDomain syn keyword sshdconfigKeyword RekeyLimit syn keyword sshdconfigKeyword RequiredRSASize syn keyword sshdconfigKeyword RevokedKeys -syn keyword sshdconfigKeyword RDomain syn keyword sshdconfigKeyword RhostsRSAAuthentication +syn keyword sshdconfigKeyword RSAAuthentication syn keyword sshdconfigKeyword SecurityKeyProvider syn keyword sshdconfigKeyword ServerKeyBits syn keyword sshdconfigKeyword SetEnv syn keyword sshdconfigKeyword ShowPatchLevel -syn keyword sshdconfigKeyword StrictModes syn keyword sshdconfigKeyword StreamLocalBindMask syn keyword sshdconfigKeyword StreamLocalBindUnlink +syn keyword sshdconfigKeyword StrictModes syn keyword sshdconfigKeyword Subsystem syn keyword sshdconfigKeyword SyslogFacility syn keyword sshdconfigKeyword TCPKeepAlive syn keyword sshdconfigKeyword TrustedUserCAKeys +syn keyword sshdconfigKeyword UnusedConnectionTimeout syn keyword sshdconfigKeyword UseBlacklist syn keyword sshdconfigKeyword UseBlocklist syn keyword sshdconfigKeyword UseDNS @@ -278,14 +276,13 @@ syn keyword sshdconfigKeyword XAuthLocation hi def link sshdconfigComment Comment hi def link sshdconfigTodo Todo hi def link sshdconfigHostPort sshdconfigConstant -hi def link sshdconfigTime sshdconfigConstant -hi def link sshdconfigNumber sshdconfigConstant +hi def link sshdconfigTime Number +hi def link sshdconfigNumber Number hi def link sshdconfigConstant Constant -hi def link sshdconfigYesNo sshdconfigEnum +hi def link sshdconfigYesNo Boolean hi def link sshdconfigAddressFamily sshdconfigEnum hi def link sshdconfigPrivilegeSeparation sshdconfigEnum hi def link sshdconfigTcpForwarding sshdconfigEnum -hi def link sshdconfigRootLogin sshdconfigEnum hi def link sshdconfigCiphers sshdconfigEnum hi def link sshdconfigMAC sshdconfigEnum hi def link sshdconfigHostKeyAlgo sshdconfigEnum -- cgit From 9b9dab622a89a620419f4e0682d235bd30d705db Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Sun, 31 Mar 2024 18:37:59 +0200 Subject: vim-patch:807fff135d52 runtime(pamconf): add support for Debian specific @includes fixes: vim/vim#14335 https://github.com/vim/vim/commit/807fff135d52fe8e6e799b78b80cccb299d246a9 Co-authored-by: Christian Brabandt --- runtime/syntax/pamconf.vim | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/pamconf.vim b/runtime/syntax/pamconf.vim index 29132848a9..1b5f901348 100644 --- a/runtime/syntax/pamconf.vim +++ b/runtime/syntax/pamconf.vim @@ -1,9 +1,9 @@ " Vim syntax file " Language: pam(8) configuration file " Previous Maintainer: Nikolai Weibull -" Latest Revision: 2020/08/04 +" Latest Change: 2024/03/31 " Changes By: Haochen Tong - +" Vim Project for the @include syntax if exists("b:current_syntax") finish @@ -23,6 +23,13 @@ syn match pamconfType '-\?[[:alpha:]]\+' syn keyword pamconfTypeKeyword contained account auth password session +" The @include syntax is Debian specific +syn match pamconfInclude '^@include' + \ nextgroup=pamconfIncludeFile + \ skipwhite + +syn match pamconfIncludeFile '\f\+$' + if s:has_service_field syn match pamconfService '^[[:graph:]]\+' \ nextgroup=pamconfType, @@ -124,6 +131,8 @@ hi def link pamconfMPath String hi def link pamconfMPathLineCont pamconfServiceLineCont hi def link pamconfArgs Normal hi def link pamconfArgsLineCont pamconfServiceLineCont +hi def link pamconfInclude Include +hi def link pamconfIncludeFile Include let b:current_syntax = "pamconf" -- cgit From feaab21c71b9c47e20ed88649bdd79b69c3806da Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 1 Apr 2024 14:57:29 +0200 Subject: vim-patch:cc7597c1edf4 runtime(yaml): improve syntax highlighting for YAML - Recognize block scalar style to avoid unexpected highlighting by `yamlFlowString` (fix vim/vim#11517) - Improve performance of `yamlFlowMappingKey` by allowing execution by the NFA engine (fix vim/vim#10730) - It was intentionally disabled before patterns were optimized by `s:SimplifyToAssumeAllPrintable`. - Fix detection of flow style mapping indicators (fix vim/vim#8234). - Enable highlighting of explicit mapping value indicators and node properties in flow style. - Add syntax highlighting tests closes: vim/vim#14354 https://github.com/vim/vim/commit/cc7597c1edf478ad912d45b27f17175236f9791e Co-authored-by: itchyny --- runtime/syntax/yaml.vim | 146 +++++++++++++++++++++++++++++------------------- 1 file changed, 89 insertions(+), 57 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/yaml.vim b/runtime/syntax/yaml.vim index 49f7d049a7..6ec806a4cb 100644 --- a/runtime/syntax/yaml.vim +++ b/runtime/syntax/yaml.vim @@ -2,8 +2,7 @@ " Language: YAML (YAML Ain't Markup Language) 1.2 " Maintainer: Nikolai Pavlov " First author: Nikolai Weibull -" Latest Revision: 2015-03-28 -" removed duplicate yamlKeyValueDelimiter (pull #4799) +" Latest Revision: 2024-04-01 if exists('b:current_syntax') finish @@ -15,21 +14,21 @@ set cpo&vim " Choose the schema to use " TODO: Validate schema if !exists('b:yaml_schema') - if exists('g:yaml_schema') - let b:yaml_schema = g:yaml_schema - else - let b:yaml_schema = 'core' - endif + if exists('g:yaml_schema') + let b:yaml_schema = g:yaml_schema + else + let b:yaml_schema = 'core' + endif endif let s:ns_char = '\%([\n\r\uFEFF \t]\@!\p\)' let s:ns_word_char = '[[:alnum:]_\-]' let s:ns_uri_char = '\%(%\x\x\|'.s:ns_word_char.'\|[#/;?:@&=+$,.!~*''()[\]]\)' let s:ns_tag_char = '\%(%\x\x\|'.s:ns_word_char.'\|[#/;?:@&=+$.~*''()]\)' -let s:c_ns_anchor_char = '\%([\n\r\uFEFF \t,[\]{}]\@!\p\)' let s:c_indicator = '[\-?:,[\]{}#&*!|>''"%@`]' let s:c_flow_indicator = '[,[\]{}]' +let s:ns_anchor_char = substitute(s:ns_char, '\v\C[\zs', '\=s:c_flow_indicator[1:-2]', '') let s:ns_char_without_c_indicator = substitute(s:ns_char, '\v\C[\zs', '\=s:c_indicator[1:-2]', '') let s:_collection = '[^\@!\(\%(\\\.\|\[^\\\]]\)\+\)]' @@ -38,8 +37,8 @@ function s:SimplifyToAssumeAllPrintable(p) return substitute(a:p, '\V\C\\%('.s:_collection.'\\@!\\p\\)', '[^\1]', '') endfunction let s:ns_char = s:SimplifyToAssumeAllPrintable(s:ns_char) +let s:ns_anchor_char = s:SimplifyToAssumeAllPrintable(s:ns_anchor_char) let s:ns_char_without_c_indicator = s:SimplifyToAssumeAllPrintable(s:ns_char_without_c_indicator) -let s:c_ns_anchor_char = s:SimplifyToAssumeAllPrintable(s:c_ns_anchor_char) function s:SimplifyAdjacentCollections(p) return substitute(a:p, '\V\C'.s:_collection.'\\|'.s:_collection, '[\1\2]', 'g') @@ -60,9 +59,10 @@ let s:c_ns_tag_property = s:c_verbatim_tag. \ '\|'.s:c_ns_shorthand_tag. \ '\|'.s:c_non_specific_tag -let s:c_ns_anchor_name = s:c_ns_anchor_char.'\+' +let s:c_ns_anchor_name = s:ns_anchor_char.'\+' let s:c_ns_anchor_property = '&'.s:c_ns_anchor_name let s:c_ns_alias_node = '\*'.s:c_ns_anchor_name +let s:c_ns_properties = '\%(\%('.s:c_ns_tag_property.'\|'.s:c_ns_anchor_property.'\)\s\+\)\+' let s:ns_directive_name = s:ns_char.'\+' @@ -100,57 +100,71 @@ execute 'syn region yamlDirective oneline start='.string('^\ze%'.s:ns_directive_ \ 'yamlReservedDirective '. \ 'keepend' -syn match yamlTAGDirective '%TAG\s\+' contained nextgroup=yamlTagHandle -execute 'syn match yamlTagHandle contained nextgroup=yamlTagPrefix '.string(s:c_tag_handle.'\s\+') -execute 'syn match yamlTagPrefix contained nextgroup=yamlComment ' . string(s:ns_tag_prefix) +syn match yamlTAGDirective /%TAG\ze\s/ contained nextgroup=yamlTagHandle skipwhite +execute 'syn match yamlTagHandle' string(s:c_tag_handle) 'contained nextgroup=yamlTagPrefix skipwhite' +execute 'syn match yamlTagPrefix' string(s:ns_tag_prefix) 'contained nextgroup=yamlComment skipwhite' -syn match yamlYAMLDirective '%YAML\s\+' contained nextgroup=yamlYAMLVersion -syn match yamlYAMLVersion '\d\+\.\d\+' contained nextgroup=yamlComment +syn match yamlYAMLDirective /%YAML\ze\s/ contained nextgroup=yamlYAMLVersion skipwhite +syn match yamlYAMLVersion /\d\+\.\d\+/ contained nextgroup=yamlComment skipwhite execute 'syn match yamlReservedDirective contained nextgroup=yamlComment '. \string('%\%(\%(TAG\|YAML\)\s\)\@!'.s:ns_directive_name) syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start='"' skip='\\"' end='"' - \ contains=yamlEscape - \ nextgroup=yamlKeyValueDelimiter + \ contains=yamlEscape contained nextgroup=yamlFlowMappingDelimiter,yamlComment skipwhite syn region yamlFlowString matchgroup=yamlFlowStringDelimiter start="'" skip="''" end="'" - \ contains=yamlSingleEscape - \ nextgroup=yamlKeyValueDelimiter + \ contains=yamlSingleEscape contained nextgroup=yamlFlowMappingDelimiter,yamlComment skipwhite syn match yamlEscape contained '\\\%([\\"abefnrtv\^0_ NLP\n]\|x\x\x\|u\x\{4}\|U\x\{8}\)' syn match yamlSingleEscape contained "''" -syn match yamlBlockScalarHeader contained '\s\+\zs[|>]\%([+-]\=[1-9]\|[1-9]\=[+-]\)\=' - syn cluster yamlConstant contains=yamlBool,yamlNull -syn cluster yamlFlow contains=yamlFlowString,yamlFlowMapping,yamlFlowCollection -syn cluster yamlFlow add=yamlFlowMappingKey,yamlFlowMappingMerge -syn cluster yamlFlow add=@yamlConstant,yamlPlainScalar,yamlFloat -syn cluster yamlFlow add=yamlTimestamp,yamlInteger,yamlMappingKeyStart -syn cluster yamlFlow add=yamlComment -syn region yamlFlowMapping matchgroup=yamlFlowIndicator start='{' end='}' contains=@yamlFlow -syn region yamlFlowCollection matchgroup=yamlFlowIndicator start='\[' end='\]' contains=@yamlFlow +syn cluster yamlFlowNode contains=yamlFlowString,yamlFlowMapping,yamlFlowCollection +syn cluster yamlFlowNode add=yamlFlowMappingKey,yamlFlowMappingKeyStart,yamlFlowMappingMerge +syn cluster yamlFlowNode add=@yamlConstant,yamlPlainScalar,yamlFloat,yamlComment +syn cluster yamlFlowNode add=yamlTimestamp,yamlInteger,yamlAlias,yamlFlowNodeProperties +syn region yamlFlowMapping matchgroup=yamlFlowIndicator start='{\@]\%([1-9][+-]\|[+-]\?[1-9]\?\)\%(\s\+#.*\)\?$' contained + \ contains=yamlComment nextgroup=yamlBlockString skipnl +syn region yamlBlockString start=/^\z(\s\+\)/ skip=/^$/ end=/^\%(\z1\)\@!/ contained + +syn cluster yamlBlockNode contains=@yamlFlowNode,yamlBlockMappingKey,yamlBlockMappingKeyString, + \yamlBlockMappingMerge,yamlBlockMappingKeyStart,yamlBlockCollectionItemStart, + \yamlBlockNodeProperties,yamlBlockScalarHeader syn cluster yamlScalarWithSpecials contains=yamlPlainScalar,yamlBlockMappingKey,yamlFlowMappingKey @@ -164,8 +178,8 @@ elseif b:yaml_schema is# 'core' syn keyword yamlNull null Null NULL contained containedin=@yamlScalarWithSpecials syn keyword yamlBool true True TRUE false False FALSE contained containedin=@yamlScalarWithSpecials exe 'syn match yamlNull /'.s:_bounder.'\@1 Date: Thu, 4 Apr 2024 23:48:43 +0200 Subject: vim-patch:5ccdcc482e29 runtime(java): Improve the matching of contextual keywords - Recognise a _record_ contextual keyword. - Recognise _non-sealed_, _sealed_, and _permits_ contextual keywords. - Admit _$_ to keyword characters. - Group _abstract_, _final_, _default_, _(non-)sealed_ (apart from _(non-)sealed_, the incompossibility of these modifiers calls for attention). - Remove another _synchronized_ keyword redefinition. I have also replaced a function with an expression. Before patch 8.1.0515, it should have been declared :function! to work with repeatable script sourcing; there is less to worry about with an expression. References: https://openjdk.org/jeps/395 (Records) https://openjdk.org/jeps/409 (Sealed Classes) https://docs.oracle.com/javase/specs/jls/se21/html/jls-3.html#jls-3.8 closes: vim/vim#14403 https://github.com/vim/vim/commit/5ccdcc482e299609ae8852a75b22190e38b9b5df Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com> --- runtime/syntax/java.vim | 78 ++++++++++++++++++++++++++++--------------------- 1 file changed, 45 insertions(+), 33 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index 1f0c158031..22fc934a0c 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -2,7 +2,7 @@ " Language: Java " Maintainer: Claudio Fleiner " URL: https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim -" Last Change: 2024 Mar 25 +" Last Change: 2024 Apr 04 " Please check :help java.vim for comments on some of the options available. @@ -19,6 +19,9 @@ endif let s:cpo_save = &cpo set cpo&vim +" Admit the ASCII dollar sign to keyword characters (JLS-17, §3.8): +execute printf('syntax iskeyword %s,$', &l:iskeyword) + " some characters that cannot be in a java program (outside a string) syn match javaError "[\\@`]" syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" @@ -27,16 +30,17 @@ syn match javaError "<<<\|\.\.\|=>\|||=\|&&=\|\*\/" syn match javaError2 "#\|=<" hi def link javaError2 javaError -" keyword definitions +" Keywords (JLS-17, §3.9): syn keyword javaExternal native package -syn match javaExternal "\\(\s\+static\>\)\?" +syn match javaExternal "\\%(\s\+static\>\)\=" syn keyword javaError goto const syn keyword javaConditional if else switch syn keyword javaRepeat while for do syn keyword javaBoolean true false syn keyword javaConstant null syn keyword javaTypedef this super -syn keyword javaOperator var new instanceof +syn keyword javaOperator new instanceof +syn match javaOperator "\\%(\s*(\)\@!" " Since the yield statement, which could take a parenthesised operand, " and _qualified_ yield methods get along within the switch block " (JLS-17, §3.8), it seems futile to make a region definition for this @@ -48,14 +52,15 @@ syn match javaOperator "\%(\%(::\|\.\)[[:space:]\n]*\)\@80" syn keyword javaType boolean char byte short int long float double syn keyword javaType void syn keyword javaStatement return -syn keyword javaStorageClass static synchronized transient volatile final strictfp serializable +syn keyword javaStorageClass static synchronized transient volatile strictfp serializable syn keyword javaExceptions throw try catch finally syn keyword javaAssert assert -syn keyword javaMethodDecl synchronized throws -syn keyword javaClassDecl extends implements interface -" to differentiate the keyword class from MyClass.class we use a match here +syn keyword javaMethodDecl throws +" Differentiate a "MyClass.class" literal from the keyword "class". syn match javaTypedef "\.\s*\"ms=s+1 -syn keyword javaClassDecl enum +syn keyword javaClassDecl enum extends implements interface +syn match javaClassDecl "\\%(\s*(\)\@!" +syn match javaClassDecl "\\%(\s*(\)\@!" syn match javaClassDecl "^class\>" syn match javaClassDecl "[^.]\s*\"ms=s+1 syn match javaAnnotation "@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" contains=javaString @@ -63,19 +68,27 @@ syn match javaClassDecl "@interface\>" syn keyword javaBranch break continue nextgroup=javaUserLabelRef skipwhite syn match javaUserLabelRef "\k\+" contained syn match javaVarArg "\.\.\." -syn keyword javaScopeDecl public protected private abstract +syn keyword javaScopeDecl public protected private +syn keyword javaConceptKind abstract final +syn match javaConceptKind "\" +syn match javaConceptKind "\\%(\s*(\)\@!" syn match javaConceptKind "\\%(\s*\%(:\|->\)\)\@!" -function s:isModuleInfoDeclarationCurrentBuffer() abort - return fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!' -endfunction - -" Java Modules(Since Java 9, for "module-info.java" file) -if s:isModuleInfoDeclarationCurrentBuffer() - syn keyword javaModuleStorageClass module transitive - syn keyword javaModuleStmt open requires exports opens uses provides - syn keyword javaModuleExternal to with - syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal +" Note that a "module-info" file will be recognised with an arbitrary +" file extension (or no extension at all) so that more than one such +" declaration for the same Java module can be maintained for modular +" testing in a project without attendant confusion for IDEs, with the +" ".java\=" extension used for a production version and an arbitrary +" extension used for a testing version. +let s:module_info_cur_buf = fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!' +lockvar s:module_info_cur_buf + +" Java modules (since Java 9, for "module-info.java" file). +if s:module_info_cur_buf + syn keyword javaModuleStorageClass module transitive + syn keyword javaModuleStmt open requires exports opens uses provides + syn keyword javaModuleExternal to with + syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal endif if exists("java_highlight_java_lang_ids") @@ -111,7 +124,7 @@ if exists("java_highlight_all") || exists("java_highlight_java") || exists("ja syn match javaC_JavaLang "\%(\" syn keyword javaC_JavaLang Boolean Character Class ClassLoader Compiler Double Float Integer Long Math Number Object Process Runtime SecurityManager String StringBuffer Thread ThreadGroup Byte Short Void InheritableThreadLocal Package RuntimePermission ThreadLocal StrictMath StackTraceElement Enum ProcessBuilder StringBuilder ClassValue Module ModuleLayer StackWalker Record syn match javaC_JavaLang "\" " See javaDebug. - " As of Java 21, java.lang.Compiler is no more (deprecated in Java 9). + " As of JDK 21, java.lang.Compiler is no more (deprecated in JDK 9). syn keyword javaLangDeprecated Compiler syn cluster javaTop add=javaC_JavaLang syn cluster javaClasses add=javaC_JavaLang @@ -275,17 +288,17 @@ syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpe if exists("java_highlight_functions") if java_highlight_functions == "indent" - syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation - syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation - syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation - syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn match javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn match javaFuncDef "^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^ [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation else " This line catches method declarations at any indentation>0, but it assumes " two things: " 1. class names are always capitalized (ie: Button) " 2. method names are never capitalized (except constructors, of course) "syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses - syn region javaFuncDef start=+^\s\+\%(\%(public\|protected\|private\|static\|\%(abstract\|default\)\|final\|native\|synchronized\)\s\+\)*\%(<.*>\s\+\)\?\%(\%(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\%([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\%(<[^(){}]*>\)\=\%(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation + syn region javaFuncDef start=+^\s\+\%(\%(public\|protected\|private\|static\|\%(abstract\|default\)\|final\|native\|synchronized\)\s\+\)*\%(<.*>\s\+\)\?\%(\%(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\%([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\%(<[^(){}]*>\)\=\%(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation endif syn match javaLambdaDef "\<\K\k*\>\%(\\)\@" syn match javaBraces "[{}]" @@ -440,10 +453,10 @@ hi def link htmlArg Type hi def link htmlString String hi def link javaSpaceError Error -if s:isModuleInfoDeclarationCurrentBuffer() - hi def link javaModuleStorageClass StorageClass - hi def link javaModuleStmt Statement - hi def link javaModuleExternal Include +if s:module_info_cur_buf + hi def link javaModuleStorageClass StorageClass + hi def link javaModuleStmt Statement + hi def link javaModuleExternal Include endif let b:current_syntax = "java" @@ -452,9 +465,8 @@ if main_syntax == 'java' unlet main_syntax endif -delfunction! s:isModuleInfoDeclarationCurrentBuffer -let b:spell_options="contained" +let b:spell_options = "contained" let &cpo = s:cpo_save -unlet s:cpo_save +unlet s:module_info_cur_buf s:cpo_save " vim: ts=8 -- cgit From cbe982bbd5a09b1337e5b3ffcbd15a34cec2db78 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 8 Apr 2024 22:51:09 +0200 Subject: vim-patch:9.1.0278: filetype: zathurarc files not recognized Problem: filetype: zathurarc files not recognized Solution: Detect '.zathurarc' files as zathurarc filetype, add zathurarc filetype (Wu, Zhenyu) closes: vim/vim#14380 https://github.com/vim/vim/commit/72d81a66edd835aeff3f539ccd0f97afb1ebd63c Co-authored-by: Wu, Zhenyu --- runtime/syntax/zathurarc.vim | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 runtime/syntax/zathurarc.vim (limited to 'runtime/syntax') diff --git a/runtime/syntax/zathurarc.vim b/runtime/syntax/zathurarc.vim new file mode 100644 index 0000000000..5e0526d02a --- /dev/null +++ b/runtime/syntax/zathurarc.vim @@ -0,0 +1,37 @@ +" Vim syntax file +" Language: Zathurarc +" Maintainer: Wu, Zhenyu +" Documentation: https://pwmt.org/projects/zathura/documentation/ +" Upstream: https://github.com/Freed-Wu/zathurarc.vim +" Latest Revision: 2024-04-02 + +if exists('b:current_syntax') + finish +endif +let b:current_syntax = 'zathurarc' + +syntax case match +syntax iskeyword @,48-57,_,192-255,- + +syntax region zathurarcComment start="\%([ \t]*\&\([^\\]\zs\|^\)\)#" end="$" +syntax match zathurarcBracket /[<>]/ contained +syntax match zathurarcNotation `<[A-Z][a-z0-9]\+>` contains=zathurarcBracket +syntax match zathurarcNumber `\<[0-9.]\>` +syntax region zathurarcString start=`"` skip=`\\"` end=`"` +syntax region zathurarcString start=`'` skip=`\\'` end=`'` +syntax keyword zathurarcMode normal fullscreen presentation index +syntax keyword zathurarcBoolean true false +syntax keyword zathurarcCommand include map set unmap +syntax keyword zathurarcOption abort-clear-search adjust-open advance-pages-per-row completion-bg completion-fg completion-group-bg completion-group-fg completion-highlight-bg completion-highlight-fg continuous-hist-save database dbus-raise-window dbus-service default-bg default-fg exec-command filemonitor first-page-column font guioptions highlight-active-color highlight-color highlight-fg highlight-transparency incremental-search index-active-bg index-active-fg index-bg index-fg inputbar-bg inputbar-fg link-hadjust link-zoom n-completion-items notification-bg notification-error-bg notification-error-fg notification-fg notification-warning-bg notification-warning-fg page-cache-size page-padding page-right-to-left page-thumbnail-size pages-per-row recolor recolor-darkcolor recolor-keephue recolor-lightcolor recolor-reverse-video render-loading render-loading-bg render-loading-fg sandbox scroll-full-overlap scroll-hstep scroll-page-aware scroll-step scroll-wrap search-hadjust selection-clipboard selection-notification show-directories show-hidden show-recent statusbar-basename statusbar-bg statusbar-fg statusbar-h-padding statusbar-home-tilde statusbar-page-percent statusbar-v-padding synctex synctex-editor-command vertical-center window-height window-icon window-icon-document window-title-basename window-title-home-tilde window-title-page window-width zoom-center zoom-max zoom-min zoom-step + +highlight default link zathurarcComment Comment +highlight default link zathurarcNumber Number +highlight default link zathurarcMode Macro +highlight default link zathurarcString String +highlight default link zathurarcBoolean Boolean +" same as vim +highlight default link zathurarcBracket Delimiter +highlight default link zathurarcNotation Special +highlight default link zathurarcCommand Statement +highlight default link zathurarcOption PreProc +" ex: nowrap -- cgit From 4a1eec85ddf4b75237df7aa8abff1180addcf03b Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 8 Apr 2024 22:52:50 +0200 Subject: vim-patch:a2385c233499 runtime(cuda): Update cuda keywords, remove uncommonly used enumeration constants closes: vim/vim#14406 https://github.com/vim/vim/commit/a2385c23349935d4bd6780a538f3a8f46a29d952 Co-authored-by: jiangyinzuo --- runtime/syntax/cuda.vim | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/cuda.vim b/runtime/syntax/cuda.vim index 13d70e343a..8306d096a0 100644 --- a/runtime/syntax/cuda.vim +++ b/runtime/syntax/cuda.vim @@ -1,7 +1,8 @@ " Vim syntax file " Language: CUDA (NVIDIA Compute Unified Device Architecture) " Maintainer: Timothy B. Terriberry -" Last Change: 2018 Feb 06 +" Last Change: 2024 Apr 04 +" Contributor: jiangyinzuo " quit when a syntax file was already loaded if exists("b:current_syntax") @@ -11,12 +12,13 @@ endif " Read the C++ syntax to start with runtime! syntax/cpp.vim -" CUDA extentions -syn keyword cudaStorageClass __device__ __global__ __host__ -syn keyword cudaStorageClass __constant__ __shared__ -syn keyword cudaStorageClass __inline__ __align__ __thread__ +" CUDA extentions. +" Reference: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#c-language-extensions +syn keyword cudaStorageClass __device__ __global__ __host__ __managed__ +syn keyword cudaStorageClass __constant__ __grid_constant__ __shared__ +syn keyword cudaStorageClass __inline__ __noinline__ __forceinline__ __inline_hint__ +syn keyword cudaStorageClass __align__ __thread__ __restrict__ "syn keyword cudaStorageClass __import__ __export__ __location__ -syn keyword cudaStructure template syn keyword cudaType char1 char2 char3 char4 syn keyword cudaType uchar1 uchar2 uchar3 uchar4 syn keyword cudaType short1 short2 short3 short4 @@ -25,37 +27,23 @@ syn keyword cudaType int1 int2 int3 int4 syn keyword cudaType uint1 uint2 uint3 uint4 syn keyword cudaType long1 long2 long3 long4 syn keyword cudaType ulong1 ulong2 ulong3 ulong4 +syn keyword cudaType longlong1 longlong2 longlong3 longlong4 +syn keyword cudaType ulonglong1 ulonglong2 ulonglong3 ulonglong4 syn keyword cudaType float1 float2 float3 float4 -syn keyword cudaType ufloat1 ufloat2 ufloat3 ufloat4 +syn keyword cudaType double1 double2 double3 double4 syn keyword cudaType dim3 texture textureReference syn keyword cudaType cudaError_t cudaDeviceProp cudaMemcpyKind syn keyword cudaType cudaArray cudaChannelFormatKind syn keyword cudaType cudaChannelFormatDesc cudaTextureAddressMode syn keyword cudaType cudaTextureFilterMode cudaTextureReadMode -syn keyword cudaVariable gridDim blockIdx blockDim threadIdx +syn keyword cudaVariable gridDim blockIdx blockDim threadIdx warpSize +syn keyword cudaConstant __CUDA_ARCH__ syn keyword cudaConstant __DEVICE_EMULATION__ +" There are too many CUDA enumeration constants. We only define a subset of commonly used constants. +" Reference: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html syn keyword cudaConstant cudaSuccess -" Many more errors are defined, but only these are listed in the maunal -syn keyword cudaConstant cudaErrorMemoryAllocation -syn keyword cudaConstant cudaErrorInvalidDevicePointer -syn keyword cudaConstant cudaErrorInvalidSymbol -syn keyword cudaConstant cudaErrorMixedDeviceExecution -syn keyword cudaConstant cudaMemcpyHostToHost -syn keyword cudaConstant cudaMemcpyHostToDevice -syn keyword cudaConstant cudaMemcpyDeviceToHost -syn keyword cudaConstant cudaMemcpyDeviceToDevice -syn keyword cudaConstant cudaReadModeElementType -syn keyword cudaConstant cudaReadModeNormalizedFloat -syn keyword cudaConstant cudaFilterModePoint -syn keyword cudaConstant cudaFilterModeLinear -syn keyword cudaConstant cudaAddressModeClamp -syn keyword cudaConstant cudaAddressModeWrap -syn keyword cudaConstant cudaChannelFormatKindSigned -syn keyword cudaConstant cudaChannelFormatKindUnsigned -syn keyword cudaConstant cudaChannelFormatKindFloat hi def link cudaStorageClass StorageClass -hi def link cudaStructure Structure hi def link cudaType Type hi def link cudaVariable Identifier hi def link cudaConstant Constant -- cgit From 41521658b1dca302a4c7125753694b59a317c0f9 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Mon, 8 Apr 2024 22:42:54 +0200 Subject: vim-patch:9.1.0276: No pandoc syntax support Problem: No pandoc syntax support Solution: Add pandoc syntax and compiler plugins (Wu, Zhenyu, Konfekt) closes: vim/vim#14389 https://github.com/vim/vim/commit/7005b7ee7f282b24378c2a844366cb8616cad5d7 Co-authored-by: Wu, Zhenyu Co-authored-by: Konfekt --- runtime/syntax/pandoc.vim | 709 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 709 insertions(+) create mode 100644 runtime/syntax/pandoc.vim (limited to 'runtime/syntax') diff --git a/runtime/syntax/pandoc.vim b/runtime/syntax/pandoc.vim new file mode 100644 index 0000000000..7928cc665d --- /dev/null +++ b/runtime/syntax/pandoc.vim @@ -0,0 +1,709 @@ +scriptencoding utf-8 +" +" Language: Pandoc (superset of Markdown) +" Maintainer: Felipe Morales +" Maintainer: Caleb Maclennan +" Upstream: https://github.com/vim-pandoc/vim-pandoc-syntax +" +" Contributor: David Sanson +" Jorge Israel Peña +" Original Author: Jeremy Schultz +" Version: 5.0 +" Last Change: 2024 Apr 08 + +let s:cpo_save = &cpo +set cpo&vim + +" Configuration: {{{1 +" +" use conceal? {{{2 +if !exists('g:pandoc#syntax#conceal#use') + let g:pandoc#syntax#conceal#use = 1 +endif +"}}}2 + +" what groups not to use conceal in. works as a blacklist {{{2 +if !exists('g:pandoc#syntax#conceal#blacklist') + let g:pandoc#syntax#conceal#blacklist = [] +endif +" }}}2 + +" cchars used in conceal rules {{{2 +" utf-8 defaults (preferred) +if &encoding ==# 'utf-8' + let s:cchars = { + \'newline': '↵', + \'image': '▨', + \'super': 'ⁿ', + \'sub': 'ₙ', + \'strike': 'x̶', + \'atx': '§', + \'codelang': 'λ', + \'codeend': '—', + \'abbrev': '→', + \'footnote': '†', + \'definition': ' ', + \'li': '•', + \'html_c_s': '‹', + \'html_c_e': '›', + \'quote_s': '“', + \'quote_e': '”'} +else + " ascii defaults + let s:cchars = { + \'newline': ' ', + \'image': 'i', + \'super': '^', + \'sub': '_', + \'strike': '~', + \'atx': '#', + \'codelang': 'l', + \'codeend': '-', + \'abbrev': 'a', + \'footnote': 'f', + \'definition': ' ', + \'li': '*', + \'html_c_s': '+', + \'html_c_e': '+'} +endif +" }}}2 + +" if the user has a dictionary with replacements for the default cchars, use those {{{2 +if exists('g:pandoc#syntax#conceal#cchar_overrides') + let s:cchars = extend(s:cchars, g:pandoc#syntax#conceal#cchar_overrides) +endif +" }}}2 + +"should the urls in links be concealed? {{{2 +if !exists('g:pandoc#syntax#conceal#urls') + let g:pandoc#syntax#conceal#urls = 0 +endif +" should backslashes in escapes be concealed? {{{2 +if !exists('g:pandoc#syntax#conceal#backslash') + let g:pandoc#syntax#conceal#backslash = 0 +endif +" }}}2 + +" leave specified codeblocks as Normal (i.e. 'unhighlighted') {{{2 +if !exists('g:pandoc#syntax#codeblocks#ignore') + let g:pandoc#syntax#codeblocks#ignore = [] +endif +" }}}2 + +" use embedded highlighting for delimited codeblocks where a language is specifed. {{{2 +if !exists('g:pandoc#syntax#codeblocks#embeds#use') + let g:pandoc#syntax#codeblocks#embeds#use = 1 +endif +" }}}2 + +" for what languages and using what vim syntax files highlight those embeds. {{{2 +" defaults to None. +if !exists('g:pandoc#syntax#codeblocks#embeds#langs') + let g:pandoc#syntax#codeblocks#embeds#langs = [] +endif +" }}}2 + +" use italics ? {{{2 +if !exists('g:pandoc#syntax#style#emphases') + let g:pandoc#syntax#style#emphases = 1 +endif +" if 0, we don't conceal the emphasis marks, otherwise there wouldn't be a way +" to tell where the styles apply. +if g:pandoc#syntax#style#emphases == 0 + call add(g:pandoc#syntax#conceal#blacklist, 'block') +endif +" }}}2 + +" underline subscript, superscript and strikeout? {{{2 +if !exists('g:pandoc#syntax#style#underline_special') + let g:pandoc#syntax#style#underline_special = 1 +endif +" }}}2 + +" protect code blocks? {{{2 +if !exists('g:pandoc#syntax#protect#codeblocks') + let g:pandoc#syntax#protect#codeblocks = 1 +endif +" }}}2 + +" use color column? {{{2 +if !exists('g:pandoc#syntax#colorcolumn') + let g:pandoc#syntax#colorcolumn = 0 +endif +" }}}2 + +" highlight new lines? {{{2 +if !exists('g:pandoc#syntax#newlines') + let g:pandoc#syntax#newlines = 1 +endif +" }}} + +" detect roman-numeral list items? {{{2 +if !exists('g:pandoc#syntax#roman_lists') + let g:pandoc#syntax#roman_lists = 0 +endif +" }}}2 + +" disable syntax highlighting for definition lists? (better performances) {{{2 +if !exists('g:pandoc#syntax#use_definition_lists') + let g:pandoc#syntax#use_definition_lists = 1 +endif +" }}}2 + +" }}}1 + +" Functions: {{{1 +" EnableEmbedsforCodeblocksWithLang {{{2 +function! EnableEmbedsforCodeblocksWithLang(entry) + " prevent embedded language syntaxes from changing 'foldmethod' + if has('folding') + let s:foldmethod = &l:foldmethod + let s:foldtext = &l:foldtext + endif + + try + let s:langname = matchstr(a:entry, '^[^=]*') + let s:langsyntaxfile = matchstr(a:entry, '[^=]*$') + unlet! b:current_syntax + exe 'syn include @'.toupper(s:langname).' syntax/'.s:langsyntaxfile.'.vim' + " We might have just turned off spellchecking by including the file, + " so we turn it back on here. + exe 'syntax spell toplevel' + exe 'syn region pandocDelimitedCodeBlock_' . s:langname . ' start=/\(\_^\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>.*\n\)\@<=\_^/' . + \' end=/\_$\n\(\( \+\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' . + \' contains=@' . toupper(s:langname) + exe 'syn region pandocDelimitedCodeBlockinBlockQuote_' . s:langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>/' . + \ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' . + \' contains=@' . toupper(s:langname) . + \',pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock' + catch /E484/ + echo "No syntax file found for '" . s:langsyntaxfile . "'" + endtry + + if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod + let &l:foldmethod = s:foldmethod + endif + if exists('s:foldtext') && s:foldtext !=# &l:foldtext + let &l:foldtext = s:foldtext + endif +endfunction +" }}}2 + +" DisableEmbedsforCodeblocksWithLang {{{2 +function! DisableEmbedsforCodeblocksWithLang(langname) + try + exe 'syn clear pandocDelimitedCodeBlock_'.a:langname + exe 'syn clear pandocDelimitedCodeBlockinBlockQuote_'.a:langname + catch /E28/ + echo "No existing highlight definitions found for '" . a:langname . "'" + endtry +endfunction +" }}}2 + +" WithConceal {{{2 +function! s:WithConceal(rule_group, rule, conceal_rule) + let l:rule_tail = '' + if g:pandoc#syntax#conceal#use != 0 + if index(g:pandoc#syntax#conceal#blacklist, a:rule_group) == -1 + let l:rule_tail = ' ' . a:conceal_rule + endif + endif + execute a:rule . l:rule_tail +endfunction +" }}}2 + +" }}}1 + +" Commands: {{{1 +command! -buffer -nargs=1 -complete=syntax PandocHighlight call EnableEmbedsforCodeblocksWithLang() +command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsforCodeblocksWithLang() +" }}}1 + +" BASE: +syntax clear +syntax spell toplevel +" }}}1 + +" Syntax Rules: {{{1 + +" Embeds: {{{2 + +" prevent embedded language syntaxes from changing 'foldmethod' +if has('folding') + let s:foldmethod = &l:foldmethod +endif + +" HTML: {{{3 +" Set embedded HTML highlighting +syn include @HTML syntax/html.vim +syn match pandocHTML /<\/\?\a\_.\{-}>/ contains=@HTML +" Support HTML multi line comments +syn region pandocHTMLComment start=// keepend contains=pandocHTMLCommentStart,pandocHTMLCommentEnd +call s:WithConceal('html_c_s', 'syn match pandocHTMLCommentStart // contained', 'conceal cchar='.s:cchars['html_c_e']) +" }}}3 + +" LaTeX: {{{3 +" Set embedded LaTex (pandoc extension) highlighting +" Unset current_syntax so the 2nd include will work +unlet b:current_syntax +syn include @LATEX syntax/tex.vim +if index(g:pandoc#syntax#conceal#blacklist, 'inlinemath') == -1 + " Can't use WithConceal here because it will mess up all other conceals + " when dollar signs are used normally. It must be skipped entirely if + " inlinemath is blacklisted + syn region pandocLaTeXInlineMath start=/\v\\@.*\n\(.*\n\@1/ contained containedin=pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted +" }}}2 + +" Code Blocks: {{{2 +if g:pandoc#syntax#protect#codeblocks == 1 + syn match pandocCodeblock /\([ ]\{4}\|\t\).*$/ +endif +syn region pandocCodeBlockInsideIndent start=/\(\(\d\|\a\|*\).*\n\)\@/ contains=NONE +" }}}3 + +" }}}2 + +" Citations: {{{2 +" parenthetical citations +syn match pandocPCite "\^\@~/]*.\{-}\]" contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell,pandocAmpersandEscape display +" in-text citations with location +syn match pandocICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=pandocCiteKey,@Spell display +" cite keys +syn match pandocCiteKey /\(-\=@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\)/ containedin=pandocPCite,pandocICite contains=@NoSpell display +syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display +syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite +" }}}2 + +" Text Styles: {{{2 + +" Emphasis: {{{3 +call s:WithConceal('block', 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape,pandocReferenceLabel,pandocReferenceURL display +syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@/ contained containedin=pandocGridTableHeader,pandocPipeTableHeader contains=@Spell +" }}}2 + +" Delimited Code Blocks: {{{2 +" this is here because we can override strikeouts and subscripts +syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend +syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\+\|\t\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend +call s:WithConceal('codeblock_start', 'syn match pandocDelimitedCodeBlockStart /\(\(\_^\n\_^\|\%^\)\(>\s\)\?\( \+\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars['codelang']) +syn match pandocDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained +call s:WithConceal('codeblock_delim', 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock', 'conceal cchar='.s:cchars['codeend']) +syn match pandocBlockQuoteinDelimitedCodeBlock '^>' contained containedin=pandocDelimitedCodeBlock +syn match pandocCodePre /
.\{-}<\/pre>/ skipnl
+syn match pandocCodePre /.\{-}<\/code>/ skipnl
+
+" enable highlighting for embedded region in codeblocks if there exists a
+" g:pandoc#syntax#codeblocks#embeds#langs *list*.
+"
+" entries in this list are the language code interpreted by pandoc,
+" if this differs from the name of the vim syntax file, append =vimname
+" e.g. let g:pandoc#syntax#codeblocks#embeds#langs = ["haskell", "literatehaskell=lhaskell"]
+"
+if g:pandoc#syntax#codeblocks#embeds#use != 0
+    for l in g:pandoc#syntax#codeblocks#embeds#langs
+      call EnableEmbedsforCodeblocksWithLang(l)
+    endfor
+endif
+" }}}2
+
+" Abbreviations: {{{2
+syn region pandocAbbreviationDefinition start=/^\*\[.\{-}\]:\s*/ end='$' contains=pandocNoFormatted,@Spell,pandocAmpersandEscape
+call s:WithConceal('abbrev', 'syn match pandocAbbreviationSeparator /:/ contained containedin=pandocAbbreviationDefinition', 'conceal cchar='.s:cchars['abbrev'])
+syn match pandocAbbreviation /\*\[.\{-}\]/ contained containedin=pandocAbbreviationDefinition
+call s:WithConceal('abbrev', 'syn match pandocAbbreviationHead /\*\[/ contained containedin=pandocAbbreviation', 'conceal')
+call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained containedin=pandocAbbreviation', 'conceal')
+" }}}2
+
+" Footnotes: {{{2
+" we put these here not to interfere with superscripts.
+syn match pandocFootnoteID /\[\^[^\]]\+\]/ nextgroup=pandocFootnoteDef
+
+"   Inline footnotes
+syn region pandocFootnoteDef start=/\^\[/ skip=/\[.\{-}]/ end=/\]/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocStrongEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell,pandocAmpersandEscape skipnl keepend
+call s:WithConceal('footnote', 'syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef', 'conceal cchar='.s:cchars['footnote'])
+call s:WithConceal('footnote', 'syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef', 'conceal')
+
+" regular footnotes
+syn region pandocFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocNewLine,pandocStrongEmphasis,pandocEllipses,pandocBeginQuote,pandocEndQuote,pandocLaTeXInlineMath,pandocEscapedDollar,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXRegion,pandocAmpersandEscape,@Spell skipnl
+syn match pandocFootnoteBlockSeparator /:/ contained containedin=pandocFootnoteBlock
+syn match pandocFootnoteID /\[\^.\{-}\]/ contained containedin=pandocFootnoteBlock
+call s:WithConceal('footnote', 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID', 'conceal cchar='.s:cchars['footnote'])
+call s:WithConceal('footnote', 'syn match pandocFootnoteIDTail /\]/ contained containedin=pandocFootnoteID', 'conceal')
+" }}}2
+
+" List Items: {{{2
+" Unordered lists
+syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocReferenceURL,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display
+call s:WithConceal('list', 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem', 'conceal cchar='.s:cchars['li'])
+
+" Ordered lists
+syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display
+
+" support for roman numerals up to 'c'
+if g:pandoc#syntax#roman_lists != 0
+    syn match pandocListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
+endif
+syn match pandocListItemBullet /^(\?.\{-}[.)]/ contained containedin=pandocListItem
+syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}\)/ contained containedin=pandocListItemBullet
+
+syn match pandocListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@[[:punct:]]*\)\@<="[[:blank:][:punct:]\n]\@=/  containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display', 'conceal cchar='.s:cchars['quote_e'])
+endif
+" }}}3
+
+" Hrule: {{{3
+syn match pandocHRule /^\s*\([*\-_]\)\s*\%(\1\s*\)\{2,}$/ display
+" }}}3
+
+" Backslashes: {{{3
+if g:pandoc#syntax#conceal#backslash == 1
+    syn match pandocBackslash /\v\\@
Date: Wed, 10 Apr 2024 06:31:10 +0800
Subject: vim-patch:e43ace558aee (#28258)

runtime(vim): Update base-syntax, no curly-brace names in Vim9 script (vim/vim#14466)

Remove curly-brace name matching for :def functions.  This is not
supported in Vim9 script.

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

Co-authored-by: dkearns 
---
 runtime/syntax/vim.vim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index e665ec8e14..f5b1071b2d 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -266,8 +266,8 @@ syn match	vimEnddef	"\"
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
  syn region	vimFuncFold	start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*("	end="\" contains=vimFunction fold keepend transparent
- syn region	vimFuncFold	start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+("	end="\"	        contains=vimDef      fold keepend transparent
- syn region	vimFuncFold	start="\"
-- 
cgit 


From d627497156162f03a36e889d316b68df66928193 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Thu, 11 Apr 2024 07:41:44 +0800
Subject: vim-patch:04e5363b8238 (#28268)

runtime(vim): Improve Vim9 and legacy-script comment highlighting (vim/vim#13104)

This is a first-pass attempt to limit matching of Vim9 and legacy-script
comments to the appropriate syntactic contexts.

Vim9-script comments are highlighted at top level in a Vim9-script file,
in all :def functions, and in all :autocmd and :commmand command blocks.
Legacy-script comments are highlighted at top level in a legacy script
file, in all :func functions and in the Vim9-script preamble before the
:vim9script marker command.

Fixes vim/vim#13047, vim/vim#11307 and vim/vim#9587.

https://github.com/vim/vim/commit/04e5363b823827f144409df011376d00ea6df750

Co-authored-by: dkearns 
---
 runtime/syntax/vim.vim | 122 ++++++++++++++++++++++++++++++++++---------------
 1 file changed, 86 insertions(+), 36 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index f5b1071b2d..4de9cb1425 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -15,6 +15,8 @@ endif
 let s:keepcpo = &cpo
 set cpo&vim
 
+let s:vim9script = "\n" .. getline(1, 32)->join("\n") =~# '\n\s*vim9\%[script]\>'
+
 " vimTodo: contains common special-notices for comments {{{2
 " Use the vimCommentGroup cluster to add your own.
 syn keyword vimTodo contained	COMBAK	FIXME	TODO	XXX
@@ -146,13 +148,13 @@ endif
 " Numbers {{{2
 " =======
 syn case ignore
-syn match	vimNumber	'\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\='	skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
-syn match	vimNumber	'\<0b[01]\+'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
-syn match	vimNumber	'\<0o\=\o\+'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
-syn match	vimNumber	'\<0x\x\+'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
-syn match	vimNumber	'\<0z\>'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
-syn match	vimNumber	'\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*'	skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
-syn match	vimNumber	'\%(^\|\A\)\zs#\x\{6}'		skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,vimComment,vim9Comment
+syn match	vimNumber	'\<\d\+\%(\.\d\+\%(e[+-]\=\d\+\)\=\)\='	skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
+syn match	vimNumber	'\<0b[01]\+'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
+syn match	vimNumber	'\<0o\=\o\+'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
+syn match	vimNumber	'\<0x\x\+'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
+syn match	vimNumber	'\<0z\>'			skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
+syn match	vimNumber	'\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*'	skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
+syn match	vimNumber	'\%(^\|\A\)\zs#\x\{6}'		skipwhite nextgroup=vimGlobal,vimSubst1,vimCommand,@vimComment
 syn case match
 
 " All vimCommands are contained by vimIsCommand. {{{2
@@ -198,7 +200,7 @@ syn keyword vimFTOption contained	detect indent off on plugin
 
 " 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,vim9Comment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
+syn cluster vimAugroupList	contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
 syn match   vimAugroup	"\" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
   syn region  vimAugroup  fold	start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd
@@ -288,15 +290,21 @@ syn match	vimUserType	contained	"\<\u\w*\>"
 
 syn cluster vimType contains=vimType,vimCompoundType,vimUserType
 
-" Keymaps: (Vim Project Addition) {{{2
+" Keymaps: {{{2
 " =======
 
-" TODO: handle Vim9 script comments when something like #13104 is merged
-syn match  vimKeymapStart	"^"	contained skipwhite nextgroup=vimKeymapLhs,vimKeymapLineComment
+syn match  vimKeymapStart	"^"	contained skipwhite nextgroup=vimKeymapLhs,@vimKeymapLineComment
 syn match  vimKeymapLhs	"\S\+"	contained skipwhite nextgroup=vimKeymapRhs contains=vimNotation
 syn match  vimKeymapRhs	"\S\+"	contained skipwhite nextgroup=vimKeymapTailComment contains=vimNotation
 syn match  vimKeymapTailComment	"\S.*"	contained
-syn match  vimKeymapLineComment	+".*+	contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
+
+" TODO: remove when :" comment is matched in parts as "ex-colon comment" --djk
+if s:vim9script
+  syn match  vim9KeymapLineComment	"#.*"	contained contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
+else
+  syn match  vimKeymapLineComment	+".*+	contained contains=@vimCommentGroup,vimCommentString,vimCommentTitle
+endif
+syn cluster vimKeymapLineComment contains=vim9\=KeymapLineComment
 
 syn region vimKeymap matchgroup=vimCommand start="\" end="\%$" contains=vimKeymapStart
 
@@ -312,9 +320,10 @@ syn match	vimSpecFileMod	"\(:[phtre]\)\+"	contained
 
 " User-Specified Commands: {{{2
 " =======================
-syn cluster	vimUserCmdList	contains=@vimCmdList,vimCmplxRepeat,vimComment,vim9Comment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
+syn cluster	vimUserCmdList	contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange
 syn keyword	vimUserCommand	contained	com[mand]
-syn match	vimUserCmd	"\.*$"	contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter
+syn match	vimUserCmdName	contained	"\<\u\w*\>" nextgroup=vimUserCmdBlock skipwhite
+syn match	vimUserCmd	"\.*$"	contains=vimUserAttrb,vimUserAttrbError,vimUserCommand,@vimUserCmdList,vimComFilter,vimCmdBlock,vimUserCmdName
 syn match	vimUserAttrbError	contained	"-\a\+\ze\s"
 syn match	vimUserAttrb	contained	"-nargs=[01*?+]"	contains=vimUserAttrbKey,vimOper
 syn match	vimUserAttrb	contained	"-complete="		contains=vimUserAttrbKey,vimOper nextgroup=vimUserAttrbCmplt,vimUserCmdError
@@ -337,20 +346,41 @@ syn match	vimUserAttrbCmpltFunc contained	",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*
 syn case match
 syn match	vimUserAttrbCmplt contained	"custom,\u\w*"
 
+syn region	vimUserCmdBlock	contained	matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList
+
 " Lower Priority Comments: after some vim commands... {{{2
 " =======================
-syn match	vimComment	excludenl +\s"[^\-:.%#=*].*$+lc=1	contains=@vimCommentGroup,vimCommentString
-syn match	vimComment	+\'lc=1
 syn match	vimCmplxRepeat	'@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)'
 
 " Set command and associated set-options (vimOptions) with comment {{{2
-syn region	vimSet		matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,vimComment,vim9Comment,vimSetString,vimSetMod
+syn region	vimSet		matchgroup=vimCommand start="\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skip="\%(\\\\\)*\\.\n\@!" end="$" end="|" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=vimSetEqual,vimOption,vimErrSetting,@vimComment,vimSetString,vimSetMod
 syn region	vimSetEqual	contained	start="[=:]\|[-+^]=" skip="\\\\\|\\\s" end="[| \t]"me=e-1 end="$"	contains=vimCtrlChar,vimSetSep,vimNotation,vimEnvvar
 syn region	vimSetString	contained	start=+="+hs=s+1	skip=+\\\\\|\\"+  end=+"+		contains=vimCtrlChar
 syn match	vimSetSep	contained	"[,:]"
@@ -473,9 +503,10 @@ syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod
 " =======
 syn match	vimAutoEventList	contained	"\(!\s\+\)\=\(\a\+,\)*\a\+"	contains=vimAutoEvent,nvimAutoEvent nextgroup=vimAutoCmdSpace
 syn match	vimAutoCmdSpace	contained	"\s\+"	nextgroup=vimAutoCmdSfxList
-syn match	vimAutoCmdSfxList	contained	"\S*"	skipwhite nextgroup=vimAutoCmdMod
+syn match	vimAutoCmdSfxList	contained	"\S*"	skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock
 syn keyword	vimAutoCmd	au[tocmd] do[autocmd] doautoa[ll]	skipwhite nextgroup=vimAutoEventList
-syn match	vimAutoCmdMod	"\(++\)\=\(once\|nested\)"
+syn match	vimAutoCmdMod	"\(++\)\=\(once\|nested\)"	skipwhite nextgroup=vimAutoCmdBlock
+syn region	vimAutoCmdBlock	contained	matchgroup=vimSep start="{" end="}" contains=@vimDefBodyList
 
 " Echo And Execute: -- prefer strings! {{{2
 " ================
@@ -616,7 +647,7 @@ if has("conceal")
  syn match	vimSynCcharValue	contained	"\S"
 endif
 
-syn match	vimSyntax	"\"	contains=vimCommand skipwhite nextgroup=vimSynType,vimComment,vim9Comment
+syn match	vimSyntax	"\"	contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment
 syn cluster vimFuncBodyList add=vimSyntax
 
 " Syntax: case {{{2
@@ -705,7 +736,7 @@ syn match	vimIsCommand	"\s*\a\+"	transparent contains=vimCommand,vimNotatio
 
 " Highlighting: {{{2
 " ============
-syn cluster	vimHighlightCluster		contains=vimHiLink,vimHiClear,vimHiKeyList,vimComment,vim9Comment
+syn cluster	vimHighlightCluster		contains=vimHiLink,vimHiClear,vimHiKeyList,@vimComment
 if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimhictermerror")
  syn match	vimHiCtermError	contained	"\D\i*"
 endif
@@ -762,16 +793,21 @@ syn match	vimCtrlChar	"[--]"
 
 " Beginners - Patterns that involve ^ {{{2
 " =========
-syn match	vimLineComment	+^[ \t:]*".*$+	contains=@vimCommentGroup,vimCommentString,vimCommentTitle,vimComment
-syn match	vimLineComment	+^[ \t:]*"\("[^"]*"\|[^"]\)*$+	contains=@vimCommentGroup,vimCommentString,vimCommentTitle
-syn match	vim9LineComment	+^[ \t:]\+#.*$+	contains=@vimCommentGroup,vimCommentString,vimCommentTitle
+if s:vim9script
+  syn match	vimLineComment	+^[ \t:]*".*$+	contains=@vimCommentGroup,vimCommentString,vimCommentTitle contained
+  syn match	vim9LineComment	+^[ \t:]*#.*$+	contains=@vimCommentGroup,vimCommentString,vim9CommentTitle
+else
+  syn match	vimLineComment	+^[ \t:]*".*$+	contains=@vimCommentGroup,vimCommentString,vimCommentTitle
+  syn match	vim9LineComment	+^[ \t:]*#.*$+	contains=@vimCommentGroup,vimCommentString,vim9CommentTitle contained
+endif
 syn match	vimCommentTitle	'"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1	contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup
-" Note: Look-behind to work around nextgroup skipnl consuming leading whitespace and preventing a match
+syn match	vim9CommentTitle	'#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1	contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup
 syn match	vimContinue		"^\s*\zs\\"
 syn match         vimContinueComment	'^\s*\zs["#]\\ .*' contained
 syn cluster	vimContinue contains=vimContinue,vimContinueComment
 syn region	vimString	start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue
 syn match	vimCommentTitleLeader	'"\s\+'ms=s+1	contained
+syn match	vim9CommentTitleLeader	'#\s\+'ms=s+1	contained
 
 " Searches And Globals: {{{2
 " ====================
@@ -780,6 +816,17 @@ syn match	vimSearchDelim	'^\s*\zs[/?]\|[/?]$'	contained
 syn region	vimGlobal	matchgroup=Statement start='\
Date: Fri, 12 Apr 2024 17:07:24 +0800
Subject: vim-patch:9.1.0304: filetype: cgdb config file is not recognized
 (#28294)

Problem:  filetype: cgdb config file is not recognized
Solution: Detect cgdbrc files as cgdbrc filetype
          (Wu, Zhenyu)

closes: vim/vim#14458

https://github.com/vim/vim/commit/1492fe69037586b6c625d42205d77dd38ba51640

Co-authored-by: Wu, Zhenyu 
---
 runtime/syntax/cgdbrc.vim | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 runtime/syntax/cgdbrc.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/cgdbrc.vim b/runtime/syntax/cgdbrc.vim
new file mode 100644
index 0000000000..1ace370d8c
--- /dev/null
+++ b/runtime/syntax/cgdbrc.vim
@@ -0,0 +1,16 @@
+" Vim syntax file
+" Language:             cgdbrc
+" Maintainer:           Wu, Zhenyu 
+" Documentation:        https://cgdb.github.io/docs/Configuring-CGDB.html
+" Latest Revision:      2024-04-09
+
+if exists('b:current_syntax')
+  finish
+endif
+let b:current_syntax = 'cgdbrc'
+
+runtime! syntax/vim.vim
+
+syn region cgdbComment		start="^\s*\#" skip="\\$" end="$" contains=@Spell
+
+highlight default link cgdbComment Comment
-- 
cgit 


From ee18c26f26452ef40ec5a99412071d7a6143a1ba Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 13 Apr 2024 18:32:23 +0200
Subject: vim-patch:122d06858568

runtime(go): fix highlighting import string followed by some comment (vim/vim#14538)

https://github.com/vim/vim/commit/122d068585686babd63f0b729759ec269171d464

Co-authored-by: Linda_pp 
---
 runtime/syntax/go.vim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/go.vim b/runtime/syntax/go.vim
index 8685867c27..feed9646fb 100644
--- a/runtime/syntax/go.vim
+++ b/runtime/syntax/go.vim
@@ -5,7 +5,7 @@
 " go.vim: Vim syntax file for Go.
 " Language:             Go
 " Maintainer:           Billie Cleek 
-" Latest Revision:      2024-03-17
+" Latest Revision:      2024-04-13
 "  2024-03-17:          - fix goPackageComment highlight (by Vim Project)
 " License:              BSD-style. See LICENSE file in source repository.
 " Repository:           https://github.com/fatih/vim-go
@@ -191,7 +191,7 @@ else
   syn region      goRawString         start=+`+ end=+`+
 endif
 
-syn match       goImportString      /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"$/ contained containedin=goImport
+syn match       goImportString      /^\%(\s\+\|import \)\(\h\w* \)\?\zs"[^"]\+"/ contained containedin=goImport
 
 if s:HighlightFormatStrings()
   " [n] notation is valid for specifying explicit argument indexes
-- 
cgit 


From b87212e66962c2738bbe763e85b450be5e6b2090 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 13 Apr 2024 18:32:39 +0200
Subject: vim-patch:5392970921ab

runtime(i3config): Line continuation is not detected for 'set' command (vim/vim#14531)

Problem:  Valid i3config syntax is highlighted as error.
Solution: Skip over line-breaks correctly.

https://github.com/vim/vim/commit/5392970921aba5112f529a5d93407ae65c285fb1

Co-authored-by: julio-b 
---
 runtime/syntax/i3config.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim
index 8131639a11..2a43b3d9e5 100644
--- a/runtime/syntax/i3config.vim
+++ b/runtime/syntax/i3config.vim
@@ -100,7 +100,7 @@ syn match i3ConfigKeyword /^no_focus .*$/ contains=i3ConfigCondition
 " 4.17 Variables
 syn match i3ConfigVariable /\$[0-9A-Za-z_:|[\]-]\+/
 syn keyword i3ConfigSetKeyword set contained
-syn match i3ConfigSet /^set \$.*$/ contains=i3ConfigSetKeyword,i3ConfigVariable,i3ConfigColor,i3ConfigString,i3ConfigNumber,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShParam,i3ConfigShOper,i3ConfigBindModkey
+syn region i3ConfigSet start=/^set\s\+\$/ skip=/\\$/ end=/$/ contains=i3ConfigSetKeyword,i3ConfigVariable,i3ConfigColor,i3ConfigString,i3ConfigNumber,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShParam,i3ConfigShOper,i3ConfigBindModkey keepend
 
 " 4.18 X resources
 syn keyword i3ConfigResourceKeyword set_from_resource contained
-- 
cgit 


From a92822835521574710a830a7de0e692bf7517fb8 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Sun, 14 Apr 2024 07:35:08 +0800
Subject: vim-patch:ce06493aeb3d (#28321)

runtime(vim): Update base-syntax, add legacy header folding

Allow for syntax-based folding of Vim9 script legacy header regions.

This is enabled with the "H" flag of the g:vimsyn_folding config variable.

closes: vim/vim#14530

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

Co-authored-by: Doug Kearns 
---
 runtime/syntax/vim.vim | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 4de9cb1425..75292b0445 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -69,7 +69,7 @@ syn case match
 " Special Vim Highlighting (not automatic) {{{1
 
 " Set up folding commands for this syntax highlighting file {{{2
-if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]'
+if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhHlmpPrt]'
  if g:vimsyn_folding =~# 'a'
   com! -nargs=* VimFolda  fold
  else
@@ -85,6 +85,11 @@ if exists("g:vimsyn_folding") && g:vimsyn_folding =~# '[afhlmpPrt]'
  else
   com! -nargs=* VimFoldh 
  endif
+ if g:vimsyn_folding =~# 'H'
+  com! -nargs=* VimFoldH  fold
+ else
+  com! -nargs=* VimFoldH 
+ endif
  if g:vimsyn_folding =~# 'l'
   com! -nargs=* VimFoldl  fold
  else
@@ -119,6 +124,7 @@ else
  com! -nargs=*	VimFolda	
  com! -nargs=*	VimFoldf	
  com! -nargs=*	VimFoldh	
+ com! -nargs=*	VimFoldH	
  com! -nargs=*	VimFoldl	
  com! -nargs=*	VimFoldm	
  com! -nargs=*	VimFoldp	
@@ -820,11 +826,11 @@ syn region	vimGlobal	matchgroup=Statement start='\
Date: Mon, 15 Apr 2024 07:46:14 +0800
Subject: vim-patch:4ba70cab37d2 (#28338)

runtime(vim): Update base-syntax, fix nested function folding (vim/vim#14397)

Only match function folding start and end patterns at the start of a
line, excluding heredocs and :append/:change/:insert commands.

Fixes vim/vim#14393

https://github.com/vim/vim/commit/4ba70cab37d2a625d8c59bb136070ef9d1976934

Co-authored-by: dkearns 
---
 runtime/syntax/vim.vim | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim
index 75292b0445..4fc640bab1 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -181,9 +181,9 @@ syn cluster vimExprList contains=vimEnvvar,vimFunc,vimFuncVar,vimNumber,vimOper,
 "   (buftype != nofile test avoids having append, change, insert show up in the command window)
 " =======================
 if &buftype != 'nofile'
- syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"		matchgroup=vimCommand end="^\.$""
- syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"		matchgroup=vimCommand end="^\.$""
- syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"		matchgroup=vimCommand end="^\.$""
+ syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=a\%[ppend]$"		matchgroup=vimCommand end="^\.$" extend
+ syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=c\%[hange]$"		matchgroup=vimCommand end="^\.$" extend
+ syn region vimInsert	matchgroup=vimCommand start="^[: \t]*\(\d\+\(,\d\+\)\=\)\=i\%[nsert]$"		matchgroup=vimCommand end="^\.$" extend
 endif
 
 " Behave! {{{2
@@ -234,12 +234,14 @@ if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
  syn match	vimOperError	")"
 endif
 
-" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
+" Functions: Tag is provided for those who wish to highlight tagged functions {{{2
 " =========
 syn cluster	vimFuncList	contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncSID,Tag
 syn cluster	vimDefList	contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncSID,Tag
-syn cluster	vimFuncBodyList	contains=@vimCmdList,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimLetHereDoc,vimLineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst
-syn cluster	vimDefBodyList	contains=@vimCmdList,vimCmplxRepeat,vim9Comment,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vim9LineComment,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst
+
+syn cluster	vimFuncBodyCommon	contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimEnvvar,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSearch,vimSpecFile,vimString,vimSubst,vimFuncFold
+syn cluster	vimFuncBodyList	contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimFuncVar,vimInsert
+syn cluster	vimDefBodyList	contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment
 
 syn region	vimFuncPattern	contained		matchgroup=vimOper start="/" end="$" contains=@vimSubstList
 syn match	vimFunction	"\"	skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey
@@ -273,9 +275,9 @@ syn match	vimEndfunction	"\"
 syn match	vimEnddef	"\"
 
 if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
- syn region	vimFuncFold	start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*("	end="\" contains=vimFunction fold keepend transparent
- syn region	vimFuncFold	start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+("		end="\"	        contains=vimDef      fold keepend transparent
- syn region	vimFuncFold	start="\"
@@ -492,7 +494,8 @@ syn keyword	vimUnlet	unl[et]		skipwhite nextgroup=vimUnletBang,vimUnletVars
 syn match	vimUnletBang	contained	"!"	skipwhite nextgroup=vimUnletVars
 syn region	vimUnletVars	contained	start="$\I\|\h" skip="\n\s*\\" end="$" end="|" contains=vimVar,vimEnvvar,vimContinue,vimString,vimNumber
 
-VimFoldh syn region vimLetHereDoc	matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$'
+VimFoldh syn region vimLetHereDoc	matchgroup=vimLetHereDocStart start='=<<\s*\%(trim\s\+\%(eval\s\+\)\=\|eval\s\+\%(trim\s\+\)\=\)\=\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\s*\z1\s*$' extend
+syn keyword	vimLet	var		skipwhite nextgroup=vimVar,vimFuncVar,vimLetHereDoc
 
 " For: {{{2
 " ===
-- 
cgit 


From 8c970d34034c874ab12b924a5e057997797868f4 Mon Sep 17 00:00:00 2001
From: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
Date: Tue, 16 Apr 2024 01:48:15 +0200
Subject: vim-patch:dd83b63eb5b7 (#28351)

runtime(i3config/swayconfig): update syntax scripts

modifications with the goals of:
- simplifying structure by using group `cluster`s
- improving visual highlighting responsiveness by using `nextgroup`
- improving recursive wm-msg command highlighting
- separating command variants meant for runtime and for config only

closes: vim/vim#14544

https://github.com/vim/vim/commit/dd83b63eb5b7884c1c882eb984778492f6951ed7
---
 runtime/syntax/i3config.vim   | 281 ++++++++++++++++++++++--------------------
 runtime/syntax/swayconfig.vim | 158 ++++++++++++------------
 2 files changed, 226 insertions(+), 213 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim
index 2a43b3d9e5..7441f9082a 100644
--- a/runtime/syntax/i3config.vim
+++ b/runtime/syntax/i3config.vim
@@ -2,8 +2,8 @@
 " Language: i3 config file
 " Original Author: Josef Litos (JosefLitos/i3config.vim)
 " Maintainer: Quentin Hibon (github user hiqua)
-" Version: 1.0.2
-" Last Change: 2023-12-28
+" Version: 1.2.1
+" Last Change: 2024-04-14
 
 " References:
 " http://i3wm.org/docs/userguide.html#configuring
@@ -27,225 +27,246 @@ syn keyword i3ConfigTodo TODO FIXME XXX contained
 syn match i3ConfigSeparator /[,;\\]/ contained
 syn match i3ConfigParen /[{}]/ contained
 syn keyword i3ConfigBoolean yes no enabled disabled on off true false contained
-syn region i3ConfigString start=/\W\@<="/ skip=/\\\("\|$\)/ end=/"\|$/ contained contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigVariable,i3ConfigExecAction keepend extend
-syn region i3ConfigString start=/\W\@<='/ skip=/\\$/ end=/'\|$/ contained contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigVariable,i3ConfigExecAction keepend extend
+" String in simpler (matchable end) and more robust (includes `extend` keyword) forms
+syn cluster i3ConfigStrIn contains=i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,@i3ConfigNumVar,i3ConfigExecAction
+syn match i3ConfigString /\(["']\)[^\\"')\]}]*\1/ contained contains=@i3ConfigStrIn
+syn region i3ConfigString start=/"[^\\"')\]}]*[\\')\]}]/ skip=/\\\@<=\("\|$\)/ end=/"\|$/ contained contains=@i3ConfigStrIn keepend extend
+syn region i3ConfigString start=/'[^\\"')\]}]*[\\")\]}]/ skip=/\\\@<=$/ end=/'\|$/ contained contains=@i3ConfigStrIn keepend extend
 syn match i3ConfigColor /#[0-9A-Fa-f]\{3,8}/ contained
 syn match i3ConfigNumber /[0-9A-Za-z_$-]\@&|+=~^*!.?]\+/ contained
-syn match i3ConfigShParam /\<-[0-9A-Za-z_-]\+\>/ contained containedin=i3ConfigVar
-syn region i3ConfigExec start=/^\s*exec\(_always\)\?\( --no-startup-id\)\? [^{]/ skip=/\\$/ end=/$/ contains=i3ConfigExecKeyword,i3ConfigExecAlwaysKeyword,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigExecAction keepend
+syn match i3ConfigShParam /\<-[A-Za-z-][0-9A-Za-z_-]*\>/ contained
+syn cluster i3ConfigSh contains=@i3ConfigIdent,i3ConfigShOper,i3ConfigShDelim,i3ConfigShParam,i3ConfigShCommand
+syn region i3ConfigExec start=/ [^{]/ skip=/\\$/ end=/$/ contained contains=i3ConfigExecAction,@i3ConfigSh keepend
+syn match i3ConfigKeyword /^\(exec_always\|exec\)/ contained nextgroup=i3ConfigExec
 
 " 4.21 Workspaces per output
-syn keyword i3ConfigWorkspaceKeyword workspace contained
-syn keyword i3ConfigWorkspaceOutput output contained
-syn keyword i3ConfigWorkspaceDir prev next back_and_forth number contained
-syn region i3ConfigWorkspaceLine start=/^workspace / skip=/\\$/ end=/$/ contains=i3ConfigWorkspaceKeyword,i3ConfigNumber,i3ConfigString,i3ConfigGaps,i3ConfigWorkspaceOutput,i3ConfigVariable,i3ConfigBoolean,i3ConfigSeparator keepend
+syn match i3ConfigOutputIdent /[^'",; ]\+/ contained contains=@i3ConfigIdent,i3ConfigColonOperator skipwhite nextgroup=i3ConfigOutputIdent
+syn region i3ConfigOutputIdent start=/['"]/ end=/\ze/ contained contains=@i3ConfigIdent skipwhite nextgroup=i3ConfigOutputIdent
+syn keyword i3ConfigOutput output contained skipwhite nextgroup=i3ConfigOutputIdent
+syn match i3ConfigWorkspaceIdent /[^'",; ]\+/ contained contains=@i3ConfigIdent skipwhite nextgroup=i3ConfigGaps,i3ConfigOutput
+syn region i3ConfigWorkspaceIdent start=/['"]/ end=/\ze/ contained contains=@i3ConfigIdent skipwhite nextgroup=i3ConfigGaps,i3ConfigOutput
+syn keyword i3ConfigKeyword workspace contained skipwhite nextgroup=i3ConfigWorkspaceIdent
 
 " 4.22 Changing colors
-syn match i3ConfigDotOperator /\./ contained
-syn keyword i3ConfigClientOpts focused focused_inactive unfocused urgent placeholder background contained
-syn match i3ConfigKeyword /^client\..*$/ contains=i3ConfigDotOperator,i3ConfigClientOpts,i3ConfigColor,i3ConfigVariable
+syn keyword i3ConfigClientOpts focused focused_inactive focused_tab_title unfocused urgent placeholder background contained skipwhite nextgroup=i3ConfigColorSeq
+syn match i3ConfigDotOperator /\./ contained nextgroup=i3ConfigClientOpts
+syn keyword i3ConfigKeyword client contained nextgroup=i3ConfigDotOperator
 
 " 4.23 Interprocess communication
-syn match i3ConfigIpcKeyword /ipc-socket/ contained
-syn match i3ConfigParamLine /^ipc-socket .*$/ contains=i3ConfigIpcKeyword
+syn region i3ConfigParamLine matchgroup=i3ConfigKeyword start=/ipc-socket / end=/$/ contained contains=i3ConfigNumber,i3ConfigShOper
 
 " 4.24 Focus follows mouse
-syn match i3ConfigKeyword /^focus_follows_mouse \(yes\|no\)$/ contains=i3ConfigBoolean
+syn keyword i3ConfigFocusFollowsMouseOpts always contained
+syn keyword i3ConfigKeyword focus_follows_mouse contained skipwhite nextgroup=i3ConfigBoolean,i3ConfigFocusFollowsMouseOpts
 
 " 4.25 Mouse warping
 syn keyword i3ConfigMouseWarpingOpts output container none contained
-syn match i3ConfigKeyword /^mouse_warping \w*$/ contains=i3ConfigMouseWarpingOpts
+syn keyword i3ConfigKeyword mouse_warping contained skipwhite nextgroup=i3ConfigMouseWarpingOpts
 
 " 4.26 Popups while fullscreen
 syn keyword i3ConfigPopupFullscreenOpts smart ignore leave_fullscreen contained
-syn match i3ConfigKeyword /^popup_during_fullscreen \w*$/ contains=i3ConfigPopupFullscreenOpts
+syn keyword i3ConfigKeyword popup_during_fullscreen contained skipwhite nextgroup=i3ConfigPopupFullscreenOpts
 
 " 4.27 Focus wrapping
 syn keyword i3ConfigFocusWrappingOpts force workspace contained
-syn match i3ConfigKeyword /^focus_wrapping \(yes\|no\|force\|workspace\)$/ contains=i3ConfigBoolean,i3ConfigFocusWrappingOpts
+syn keyword i3ConfigKeyword focus_wrapping contained skipwhite nextgroup=i3ConfigBoolean,i3ConfigFocusWrappingOpts
 
 " 4.28 Forcing Xinerama
-syn match i3ConfigKeyword /^force_xinerama \(yes\|no\)$/ contains=i3ConfigBoolean
-
 " 4.29 Automatic workspace back-and-forth
-syn match i3ConfigKeyword /^workspace_auto_back_and_forth \(yes\|no\)$/ contains=i3ConfigBoolean
+" 4.32 Show marks in title
+syn keyword i3ConfigKeyword force_xinerama workspace_auto_back_and_forth show_marks contained skipwhite nextgroup=i3ConfigBoolean
 
 " 4.30 Delay urgency hint
-syn keyword i3ConfigTimeUnit ms contained
-syn match i3ConfigKeyword /^force_display_urgency_hint \d\+\( ms\)\?$/ contains=i3ConfigNumber,i3ConfigTimeUnit
+syn match i3ConfigTimeUnit / \d\+\( ms\)\?$/ contained contains=i3ConfigNumber
+syn keyword i3ConfigKeyword force_display_urgency_hint contained nextgroup=i3ConfigTimeUnit
 
 " 4.31 Focus on window activation
 syn keyword i3ConfigFocusOnActivationOpts smart urgent focus none contained
-syn match i3ConfigKeyword /^focus_on_window_activation \w*$/  contains=i3ConfigFocusOnActivationOpts
-
-" 4.32 Show marks in title
-syn match i3ConfigShowMarks /^show_marks \(yes\|no\)$/ contains=i3ConfigBoolean
+syn keyword i3ConfigKeyword focus_on_window_activation contained skipwhite nextgroup=i3ConfigFocusOnActivationOpts
 
 " 4.34 Tiling drag
-syn keyword i3ConfigTilingDragOpts modifier titlebar contained
-syn match i3ConfigKeyword /^tiling_drag\( off\|\( modifier\| titlebar\)\{1,2\}\)$/ contains=i3ConfigTilingDragOpts,i3ConfigBoolean
+syn keyword i3ConfigTilingDragOpts modifier titlebar contained skipwhite nextgroup=i3ConfigTilingDragOpts
+syn keyword i3ConfigKeyword tiling_drag contained skipwhite nextgroup=i3ConfigTilingDragOpts,i3ConfigBoolean
+
+" 4.35 Gaps (+6.24)
+syn keyword i3ConfigGapsWhich inner outer horizontal vertical left right top bottom contained skipwhite nextgroup=i3ConfigGapsWhere,@i3ConfigNumVar
+syn keyword i3ConfigGapsWhere current all contained skipwhite nextgroup=i3ConfigGapsOper
+syn keyword i3ConfigGapsOper set plus minus toggle contained skipwhite nextgroup=@i3ConfigNumVar
+syn match i3ConfigGaps /gaps/ contained contains=i3ConfigCommand skipwhite nextgroup=i3ConfigGapsWhich
+syn keyword i3ConfigCommand gaps contained skipwhite nextgroup=i3ConfigGapsWhich
 
-" 4.35 Gaps
-syn keyword i3ConfigGapsOpts inner outer horizontal vertical left right top bottom current all set plus minus toggle contained
-syn region i3ConfigGaps start=/gaps/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigGapsOpts,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend
-syn match i3ConfigGapsLine /^gaps .*$/ contains=i3ConfigGaps
-syn keyword i3ConfigSmartGapOpts inverse_outer contained
-syn match i3ConfigKeyword /^smart_gaps \(on\|off\|inverse_outer\)$/ contains=i3ConfigSmartGapOpts,i3ConfigBoolean
+syn keyword i3ConfigSmartGapOpts inverse_outer toggle contained
+syn keyword i3ConfigKeyword smart_gaps contained skipwhite nextgroup=i3ConfigSmartGapOpts,i3ConfigBoolean
 
 " 5 Configuring bar
-syn match i3ConfigBarModifier /^\s\+modifier \S\+$/ contained contains=i3ConfigBindModifier,i3ConfigVariable,i3ConfigBindModkey,i3ConfigBarOptVals
-syn keyword i3ConfigBarOpts bar i3bar_command status_command workspace_command mode hidden_state id position output tray_output tray_padding separator_symbol workspace_buttons workspace_min_width strip_workspace_numbers strip_workspace_name binding_mode_indicator padding contained
+syn keyword i3ConfigBarOpts modifier contained skipwhite nextgroup=i3ConfigBindCombo,i3ConfigBarOptVals
+syn keyword i3ConfigBarOpts i3bar_command status_command workspace_command contained skipwhite nextgroup=@i3ConfigSh
+syn keyword i3ConfigBarOpts mode hidden_state id position output tray_output tray_padding separator_symbol workspace_buttons workspace_min_width strip_workspace_numbers strip_workspace_name binding_mode_indicator padding contained skipwhite nextgroup=i3ConfigBarOptVals,@i3ConfigValue,i3ConfigShOper
 syn keyword i3ConfigBarOptVals dock hide invisible show none top bottom primary nonprimary contained
-syn region i3ConfigBarBlock start=/^bar {$/ end=/^}$/ contains=i3ConfigBarOpts,i3ConfigBarOptVals,i3ConfigBarModifier,i3ConfigBind,i3ConfigString,i3ConfigComment,i3ConfigFont,i3ConfigBoolean,i3ConfigNumber,i3ConfigParen,i3ConfigColor,i3ConfigVariable,i3ConfigColorsBlock,i3ConfigShOper,i3ConfigShCommand fold keepend extend
+syn region i3ConfigBarBlock matchgroup=i3ConfigKeyword start=/^bar\ze {$/ end=/^}\zs$/ contained contains=i3ConfigBarOpts,i3ConfigComment,i3ConfigParen,i3ConfigBindKeyword,i3ConfigColorsBlock fold keepend extend
 
 " 5.16 Color block
-syn keyword i3ConfigColorsKeyword colors contained
-syn match i3ConfigColorsOpts /\(focused_\)\?\(background\|statusline\|separator\)\|\(focused\|active\|inactive\|urgent\)_workspace\|binding_mode/ contained
-syn region i3ConfigColorsBlock start=/^\s\+colors {$/ end=/^\s\+}$/ contained contains=i3ConfigColorsKeyword,i3ConfigColorsOpts,i3ConfigColor,i3ConfigVariable,i3ConfigComment,i3ConfigParen fold keepend extend
+syn match i3ConfigColorSeq /#[0-9A-Fa-f]\{3,8}\|\$[0-9A-Za-z_:|[\]-]\+/ contained contains=@i3ConfigColVar skipwhite nextgroup=i3ConfigColorSeq
+syn keyword i3ConfigColorsOpts background statusline separator contained skipwhite nextgroup=@i3ConfigColVar
+syn match i3ConfigColorsOpts /focused_\(background\|statusline\|separator\)\|\(focused\|active\|inactive\|urgent\)_workspace\|binding_mode/ contained skipwhite nextgroup=i3ConfigColorSeq
+syn region i3ConfigColorsBlock matchgroup=i3ConfigKeyword start=/^\s\+colors \ze{$/ end=/^\s\+}\zs$/ contained contains=i3ConfigColorsOpts,i3ConfigComment,i3ConfigParen fold keepend extend
 
 " 6.0 Command criteria
 syn keyword i3ConfigConditionProp class instance window_role window_type machine id title urgent workspace con_mark con_id floating_from tiling_from contained
 syn keyword i3ConfigConditionSpecial __focused__ all floating tiling contained
-syn region i3ConfigCondition start=/\[/ end=/\]/ contained contains=i3ConfigShDelim,i3ConfigConditionProp,i3ConfigShOper,i3ConfigConditionSpecial,i3ConfigNumber,i3ConfigString keepend extend
-syn region i3ConfigCriteria start=/\[/ skip=/\\$/ end=/\(;\|$\)/ contained contains=i3ConfigCondition,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigBoolean,i3ConfigNumber,i3ConfigVariable,i3ConfigSeparator keepend transparent
+syn region i3ConfigCondition matchgroup=i3ConfigShDelim start=/\[/ end=/\]/ contained contains=i3ConfigConditionProp,i3ConfigShOper,i3ConfigConditionSpecial,@i3ConfigIdent keepend extend
+syn region i3ConfigCriteria start=/\[/ skip=/\\$/ end=/\(;\|$\)/ contained contains=i3ConfigCondition,@i3ConfigCommand,i3ConfigSeparator keepend transparent
 
 " 6.1 Actions through shell
 syn match i3ConfigExecActionKeyword /i3-msg/ contained
-syn region i3ConfigExecAction start=/[a-z3-]\+msg "/ skip=/ "\|\\$/ end=/"\|$/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend
-syn region i3ConfigExecAction start=/[a-z3-]\+msg '/ skip=/ '\|\\$/ end=/'\|$/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend
-syn region i3ConfigExecAction start=/[a-z3-]\+msg ['"-]\@!/ skip=/\\$/ end=/[&|;})'"]\@=\|$/ contained contains=i3ConfigExecActionKeyword,i3ConfigShCommand,i3ConfigNumber,i3ConfigShOper,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigVariable keepend extend
+syn cluster i3ConfigExecActionVal contains=i3ConfigExecActionKeyword,i3ConfigCriteria,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,@i3ConfigNumVar
+syn region i3ConfigExecAction start=/[a-z3-]\+msg "/ skip=/ "\|\\$/ end=/"\|$/ contained contains=i3ConfigExecActionKeyword,@i3ConfigExecActionVal keepend extend
+syn region i3ConfigExecAction start=/[a-z3-]\+msg '/ skip=/ '\|\\$/ end=/'\|$/ contained contains=i3ConfigExecActionKeyword,@i3ConfigExecActionVal keepend extend
+syn region i3ConfigExecAction start=/[a-z3-]\+msg ['"-]\@!/ skip=/\\$/ end=/[&|;})'"]\@=\|$/ contained contains=i3ConfigExecActionKeyword,@i3ConfigExecActionVal keepend extend
 " 6.1 Executing applications (4.20)
-syn region i3ConfigAction start=/exec/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigExecKeyword,i3ConfigExecAction,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigSeparator keepend
+syn region i3ConfigAction matchgroup=i3ConfigCommand start=/exec / skip=/\\$/ end=/\ze[,;]\|$/ contained contains=i3ConfigExecAction,@i3ConfigSh keepend
 
 " 6.3 Manipulating layout
-syn keyword i3ConfigLayoutKeyword layout contained
 syn keyword i3ConfigLayoutOpts default tabbed stacking splitv splith toggle split all contained
-syn region i3ConfigAction start=/layout/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigLayoutKeyword,i3ConfigLayoutOpts,i3ConfigSeparator keepend transparent
+syn region i3ConfigAction matchgroup=i3ConfigCommand start=/layout / skip=/\\$/ end=/\ze[,;]\|$/ contained contains=i3ConfigLayoutOpts keepend transparent
 
 " 6.4 Focusing containers
-syn keyword i3ConfigFocusKeyword focus contained
-syn keyword i3ConfigFocusOpts left right up down workspace parent child next prev sibling floating tiling mode_toggle contained
-syn keyword i3ConfigFocusOutputOpts left right down up current primary nonprimary next prev contained
-syn region i3ConfigFocusOutput start=/ output / skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigWorkspaceOutput,i3ConfigFocusOutputOpts,i3ConfigString,i3ConfigNumber,i3ConfigSeparator keepend
-syn match i3ConfigFocusOutputLine /^focus output .*$/ contains=i3ConfigFocusKeyword,i3ConfigFocusOutput
-syn region i3ConfigAction start=/focus/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigFocusKeyword,i3ConfigFocusOpts,i3ConfigFocusOutput,i3ConfigString,i3ConfigSeparator keepend transparent
+syn keyword i3ConfigFocusOpts left right up down parent child next prev sibling floating tiling mode_toggle contained
+syn keyword i3ConfigOutputDir left right down up current primary nonprimary next prev contained skipwhite
+syn keyword i3ConfigFocusOutput output contained skipwhite nextgroup=i3ConfigOutputIdent,i3ConfigOutputDir
+syn keyword i3ConfigActionKeyword focus contained skipwhite nextgroup=i3ConfigFocusOpts,i3ConfigFocusOutput
+syn match i3ConfigKeyword /^focus / contained nextgroup=i3ConfigFocusOutput
 
 " 6.8 Focusing workspaces (4.21)
-syn region i3ConfigAction start=/workspace / skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigWorkspaceKeyword,i3ConfigWorkspaceDir,i3ConfigNumber,i3ConfigString,i3ConfigGaps,i3ConfigWorkspaceOutput,i3ConfigVariable,i3ConfigBoolean,i3ConfigSeparator keepend transparent
+syn keyword i3ConfigWorkspaceDir prev next back_and_forth contained
+syn keyword i3ConfigWorkspaceDir number contained skipwhite nextgroup=i3ConfigWorkspaceIdent
+syn keyword i3ConfigActionKeyword workspace contained skipwhite nextgroup=i3ConfigWorkspaceDir,i3ConfigWorkspaceIdent
 
 " 6.8.2 Renaming workspaces
-syn keyword i3ConfigRenameKeyword rename contained
-syn region i3ConfigAction start=/rename workspace/ end=/[,;]\|$/ contained contains=i3ConfigRenameKeyword,i3ConfigMoveDir,i3ConfigMoveType,i3ConfigNumber,i3ConfigVariable,i3ConfigString keepend transparent
+syn region i3ConfigWorkspaceFromTo start=/workspace\( .*\)\? to/ end=/\ze[,;]\|$/ contained contains=i3ConfigMoveType,@i3ConfigWorkspaceIdent keepend transparent
+syn keyword i3ConfigActionKeyword rename contained skipwhite nextgroup=i3ConfigWorkspaceFromTo
 
 " 6.5,6.9-6.11 Moving containers
-syn keyword i3ConfigMoveKeyword move contained
-syn keyword i3ConfigMoveDir left right down up position absolute center to current contained
-syn keyword i3ConfigMoveType window container workspace output mark mouse scratchpad contained
-syn match i3ConfigUnit / px\| ppt/ contained
-syn region i3ConfigAction start=/move/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigMoveKeyword,i3ConfigMoveDir,i3ConfigMoveType,i3ConfigWorkspaceDir,i3ConfigUnit,i3ConfigNumber,i3ConfigVariable,i3ConfigString,i3ConfigSeparator,i3ConfigShParam keepend transparent
+syn match i3ConfigUnit /-\?\d\+\( px\| ppt\)\?/ contained contains=i3ConfigNumber skipwhite nextgroup=i3ConfigUnit,i3ConfigResizeExtra
+syn keyword i3ConfigMoveDir left right down up position contained skipwhite nextgroup=i3ConfigUnit
+syn match i3ConfigMoveDir /position \(mouse\|center\)/ contained
+syn keyword i3ConfigMoveDir absolute contained skipwhite nextgroup=i3ConfigMoveDir
+syn keyword i3ConfigMoveDir absolute contained
+
+syn keyword i3ConfigMoveType mark contained skipwhite nextgroup=i3ConfigOutputIdent
+syn keyword i3ConfigMoveType scratchpad contained
+syn keyword i3ConfigMoveType output contained skipwhite nextgroup=i3ConfigOutputIdent,i3ConfigOutputDir
+syn keyword i3ConfigMoveType workspace contained skipwhite nextgroup=i3ConfigMoveType,i3ConfigWorkspaceIdent,i3ConfigWorkspaceDir
+syn keyword i3ConfigMoveType window container contained skipwhite nextgroup=i3ConfigMoveType
+syn keyword i3ConfigMoveTo to contained
+syn match i3ConfigMoveType /to/ contained contains=i3ConfigMoveTo skipwhite nextgroup=i3ConfigMoveType
+syn match i3ConfigActionKeyword /move\( --no-auto-back-and-forth\)\?/ contained contains=i3ConfigShParam skipwhite nextgroup=i3ConfigMoveType,i3ConfigMoveDir
 
 " 6.12 Resizing containers/windows
-syn keyword i3ConfigResizeKeyword resize contained
-syn keyword i3ConfigResizeOpts grow shrink up down left right set width height or contained
-syn region i3ConfigAction start=/resize/ skip=/\\$/ end=/[,;]\|$/ contained contains=i3ConfigResizeKeyword,i3ConfigResizeOpts,i3ConfigNumber,i3ConfigUnit,i3ConfigSeparator keepend transparent
+syn keyword i3ConfigResizeExtra or height contained skipwhite nextgroup=i3ConfigUnit
+syn keyword i3ConfigResizeDir up down left right width height contained skipwhite nextgroup=i3ConfigUnit
+syn keyword i3ConfigResizeType grow shrink contained skipwhite nextgroup=i3ConfigResizeDir
+syn keyword i3ConfigResizeType set contained skipwhite nextgroup=i3ConfigResizeDir,i3ConfigUnit
+syn keyword i3ConfigActionKeyword resize contained skipwhite nextgroup=i3ConfigResizeType
 
 " 6.14 VIM-like marks
-syn match i3ConfigMark /mark\( --\(add\|replace\)\( --toggle\)\?\)\?/ contained contains=i3ConfigShParam
-syn region i3ConfigAction start=/\
-" Version: 1.0.2
-" Last Change: 2023-12-28
+" Version: 1.2.1
+" Last Change: 2024-04-14
 
 " References:
 " http://i3wm.org/docs/userguide.html#configuring
@@ -18,40 +18,33 @@ endif
 
 runtime! syntax/i3config.vim
 
-" i3 extensions
-syn keyword i3ConfigActionKeyword opacity urgent shortcuts_inhibitor splitv splith splitt contained
-syn keyword i3ConfigOption set plus minus allow deny csd v h t contained
+" Sway extensions to i3
+syn cluster i3ConfigCommand contains=i3ConfigCommand,i3ConfigAction,i3ConfigActionKeyword,@i3ConfigValue,i3ConfigColor,i3ConfigKeyword
+syn keyword i3ConfigActionKeyword opacity urgent shortcuts_inhibitor splitv splith splitt contained contained skipwhite nextgroup=i3ConfigOption
+syn keyword i3ConfigOption set plus minus allow deny csd v h t contained contained skipwhite nextgroup=i3ConfigOption,@i3ConfigValue
 
 syn keyword i3ConfigConditionProp app_id pid shell contained
 
 syn keyword i3ConfigWorkspaceDir prev_on_output next_on_output contained
 
-syn keyword swayConfigBindKeyword bindswitch bindgesture contained
-syn match i3ConfigBindArgument /--\(locked\|to-code\|no-repeat\|input-device=[:0-9a-zA-Z_/-]\+\|no-warn\)/ contained
-syn region i3ConfigBind start=/^\s*bind\(switch\|gesture\) / skip=/\\$/ end=/$/ contains=swayConfigBindKeyword,swayConfigBindswitch,swayConfigBindswitchArgument,swayConfigBindgesture,swayConfigBindgestureArgument,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean keepend
+syn match i3ConfigBindArgument /--\(locked\|to-code\|no-repeat\|input-device=[^ '"]*\|no-warn\) / contained contains=i3ConfigShOper,@i3ConfigStrVar nextgroup=i3ConfigBindArgument,i3ConfigBindCombo
+syn region i3ConfigBindArgument start=/--input-device=['"]/ end=/\s/ contained contains=@i3ConfigIdent,i3ConfigShOper,i3ConfigString nextgroup=i3ConfigBindArgument,i3ConfigBindCombo
 
-syn match swayConfigBindBlockHeader /^\s*bind\(sym\|code\) .*{$/ contained contains=i3ConfigBindKeyword,i3ConfigBindArgument,i3ConfigParen
-syn match swayConfigBindBlockCombo /^\s\+\(--[a-z-]\+ \)*[$a-zA-Z0-9_+]\+ [a-z[]\@=/ contained contains=i3ConfigBindArgument,i3ConfigBindCombo
-syn region i3ConfigBind start=/^\s*bind\(sym\|code\) .*{$/ end=/^\s*}$/ contains=swayConfigBindBlockHeader,swayConfigBindBlockCombo,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean,i3ConfigComment,i3ConfigParen fold keepend extend
-" fix for extra long bindsym blocks that would be parsed incorrectly when scrolling up
-syn region i3ConfigBlockOrphan start=/^\s\+\S/ skip=/^\s\|^$/ end=/^}\?/ contains=swayConfigBindBlockCombo,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean,i3ConfigComment,i3ConfigParen keepend extend
+syn region i3ConfigBindCombo matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigComment fold keepend extend
+" hack for blocks with start outside parsing range
+syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*[$a-zA-Z0-9_+]\+ [a-z[]/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigParen keepend extend
 
-syn keyword i3ConfigClientOpts focused_tab_title contained
-
-syn region swayConfigExecBlock start=/exec\(_always\)\? {/ end=/^}$/ contains=i3ConfigExecKeyword,i3ConfigExecAlwaysKeyword,i3ConfigShCommand,i3ConfigShDelim,i3ConfigShOper,i3ConfigShParam,i3ConfigNumber,i3ConfigString,i3ConfigVariable,i3ConfigComment fold keepend extend
+syn region i3ConfigExec start=/ {$/ end=/^}$/ contained contains=i3ConfigExecAction,@i3ConfigSh,i3ConfigComment fold keepend extend
 
 syn keyword swayConfigFloatingModifierOpts normal inverse contained
 syn match i3ConfigKeyword /^floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts
 
-syn keyword swayConfigSmartGapsOpts toggle contained
-syn match i3ConfigKeyword /^smart_gaps toggle$/ contains=i3ConfigSmartGapOpts,i3ConfigBoolean,swayConfigSmartGapsOpts
-
-syn keyword swayConfigFocusFollowsMouseOpts always contained
-syn match i3ConfigKeyword /^focus_follows_mouse always$/ contains=i3ConfigBoolean,swayConfigFocusFollowsMouseOpts
+syn match swayConfigI3Param /--i3/ contains=i3ConfigShParam skipwhite nextgroup=i3ConfigEdgeOpts
+syn keyword i3ConfigKeyword hide_edge_borders contained skipwhite nextgroup=swayConfigI3Param,i3ConfigEdgeOpts
 
-syn match i3ConfigKeyword /^hide_edge_borders --i3 \w*$/ contains=i3ConfigEdgeKeyword,i3ConfigShParam
-
-syn keyword i3ConfigBarOpts swaybar_command gaps height pango_markup status_edge_padding status_padding wrap_scroll tray_bindcode tray_bindsym icon_theme contained
+syn keyword i3ConfigBarOpts swaybar_command contained skipwhite nextgroup=@i3ConfigSh
+syn region i3ConfigBarOpts matchgroup=i3ConfigBarOpts start=/gaps/ end=/$/ contained contains=@i3ConfigNumVar
+syn keyword i3ConfigBarOpts height pango_markup status_edge_padding status_padding wrap_scroll tray_bindcode tray_bindsym icon_theme contained skipwhite nextgroup=i3ConfigBarOptVals,@i3ConfigValue,i3ConfigShOper
 syn keyword i3ConfigBarOptVals overlay contained
 
 syn keyword i3ConfigExecActionKeyword swaymsg contained
@@ -59,77 +52,88 @@ syn keyword i3ConfigExecActionKeyword swaymsg contained
 " Sway-only options
 " Xwayland
 syn keyword swayConfigXOpt enable disable force contained
-syn match i3ConfigKeyword /^xwayland \w*$/ contains=swayConfigXOpt
+syn keyword i3ConfigKeyword xwayland contained skipwhite nextgroup=swayConfigXOpt
 
 " Inhibit idle
-syn keyword swayConfigInhibitKeyword inhibit_idle contained
 syn keyword swayConfigInhibitOpts focus fullscreen open none visible contained
-syn match i3ConfigAction /inhibit_idle \w*/ contained contains=swayConfigInhibitKeyword,swayConfigInhibitOpts
+syn keyword i3ConfigActionKeyword inhibit_idle contained skipwhite nextgroup=swayConfigInhibitOpts
 
 " Bindswitch
-syn match swayConfigBindswitchArgument /--\(locked\|no-warn\|reload\)/ contained
-syn keyword swayConfigBindswitchType lid tablet contained
+syn match swayConfigBindswitchArgument /--\(locked\|no-warn\|reload\) / contained nextgroup=swayConfigBindswitchArgument,swayConfigBindswitchType
+syn keyword swayConfigBindswitchType lid tablet contained nextgroup=swayConfigBindswitchCombo
 syn keyword swayConfigBindswitchState toggle contained
-syn match swayConfigBindswitch /\(lid\|tablet\):\(on\|off\|toggle\) / contained contains=swayConfigBindswitchType,i3ConfigColonOperator,swayConfigBindswitchState,i3ConfigBoolean
-syn region i3ConfigBind start=/^\s*bindswitch\s\+.*{$/ end=/^\s*}$/ contains=swayConfigBindKeyword,swayConfigBindswitch,swayConfigBindswitchArgument,i3ConfigNumber,i3ConfigVariable,i3ConfigAction,i3ConfigActionKeyword,i3ConfigOption,i3ConfigSeparator,i3ConfigString,i3ConfigCriteria,swayConfigOutputCommand,i3ConfigBoolean,i3ConfigComment,i3ConfigParen fold keepend extend
+syn match swayConfigBindswitchCombo /:\(on\|off\|toggle\) / contained contains=i3ConfigColonOperator,swayConfigBindswitchState,i3ConfigBoolean nextgroup=i3ConfigBind
+syn region swayConfigBindswitchType matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=swayConfigBindswitchArgument,swayConfigBindswitchType,i3ConfigComment fold keepend extend
+syn keyword i3ConfigBindKeyword bindswitch contained skipwhite nextgroup=swayConfigBindswitchArgument,swayConfigBindswitchType
+" hack for blocks with start outside parsing range
+syn region swayConfigBlockOrphan start=/^\s\+\(lid\|tablet\):/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=swayConfigBindswitchArgument,swayConfigBindswitchType,i3ConfigParen keepend extend
 
 " Bindgesture
-syn match swayConfigBindgestureArgument /--\(exact\|input-device=[:0-9a-zA-Z_/-]\+\|no-warn\)/ contained
+syn match swayConfigBindgestureArgument /--\(exact\|input-device=[:0-9a-zA-Z_/-]\+\|no-warn\) / contained nextgroup=swayConfigBindgestureArgument,swayConfigBindgestureCombo
 syn keyword swayConfigBindgestureType hold swipe pinch contained
 syn keyword swayConfigBindgestureDir up down left right inward outward clockwise counterclockwise contained
-syn match swayConfigBindgesture /\(hold\(:[1-5]\)\?\|swipe\(:[3-5]\)\?\(:up\|:down\|:left\|:right\)\?\|pinch\(:[2-5]\)\?:\(+\?\(inward\|outward\|clockwise\|counterclockwise\|up\|down\|left\|right\)\)\+\) / contained contains=i3ConfigNumber,swayConfigBindgestureType,i3ConfigColonOperator,swayConfigBindgestureDir,i3ConfigBindModifier
-syn region i3ConfigBind start=/^\s*bindgesture\s\+.*{$/ end=/^\s*}$/ contains=swayConfigBindKeyword,swayConfigBindgesture,swayConfigBindgestureArgument,i3ConfigCriteria,i3ConfigAction,i3ConfigSeparator,i3ConfigActionKeyword,i3ConfigOption,i3ConfigString,i3ConfigNumber,i3ConfigVariable,i3ConfigBoolean,i3ConfigParen fold keepend extend
+syn match swayConfigBindgestureCombo /\(hold\(:[1-5]\)\?\|swipe\(:[3-5]\)\?\(:up\|:down\|:left\|:right\)\?\|pinch\(:[2-5]\)\?:\(+\?\(inward\|outward\|clockwise\|counterclockwise\|up\|down\|left\|right\)\)\+\) / contained contains=i3ConfigNumber,swayConfigBindgestureType,i3ConfigColonOperator,swayConfigBindgestureDir,i3ConfigBindModifier nextgroup=swayConfigBindgestureCombo,i3ConfigBind
+syn region swayConfigBindgestureCombo matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=swayConfigBindgestureArgument,swayConfigBindgestureCombo,i3ConfigComment fold keepend extend
+syn keyword i3ConfigBindKeyword bindgesture contained skipwhite nextgroup=swayConfigBindgestureArgument,swayConfigBindgestureCombo
+" hack for blocks with start outside parsing range
+syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*\(hold\|swipe\|pinch\):/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=swayConfigBindgestureArgument,swayConfigBindgestureCombo,i3ConfigParen keepend extend
 
 " Tiling drag threshold
-syn match i3ConfigKeyword /^tiling_drag_threshold \d\+$/ contains=i3ConfigNumber
-
 " Titlebar commands
-syn match i3ConfigKeyword /^titlebar_border_thickness \(\d\+\|\$\S\+\)$/ contains=i3ConfigNumber,i3ConfigVariable
-syn match i3ConfigKeyword /^titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contains=i3ConfigNumber,i3ConfigVariable
+syn keyword i3ConfigKeyword tiling_drag_threshold titlebar_border_thickness contained skipwhite nextgroup=@i3ConfigNumVar
+syn match i3ConfigKeyword /^titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contains=@i3ConfigNumVar
 
-syn match swayConfigDeviceOps /[*,:;]/ contained
+syn match swayConfigDeviceOper /[*:;!]/ contained
 
 " Input devices
-syn keyword swayConfigInputKeyword input contained
-syn keyword swayConfigInputType touchpad pointer keyboard touch tablet_tool tablet_pad switch contained
-syn match swayConfigInputTypePair /\/ contained contains=i3ConfigColonOperator,swayConfigInputType
-syn region swayConfigInputStart start=/^input / end=/\s/ contained contains=swayConfigInputKeyword,swayConfigInputTypePair,i3ConfigString keepend extend
-syn keyword swayConfigInputOpts xkb_layout xkb_variant xkb_rules xkb_switch_layout xkb_numlock xkb_file xkb_capslock xkb_model repeat_delay repeat_rate map_to_output map_to_region map_from_region tool_mode accel_profile dwt dwtp drag_lock drag click_method middle_emulation tap events calibration_matrix natural_scroll left_handed pointer_accel scroll_button scroll_factor scroll_method tap_button_map contained
-syn keyword swayConfigInputOptVals absolute relative adaptive flat none button_areas clickfinger toggle two_finger edge on_button_down lrm lmr next prev pen eraser brush pencil airbrush disabled_on_external_mouse disable contained
-syn match swayConfigXkbOptsPairVal /:[0-9a-z_-]\+/ contained contains=i3ConfigColonOperator
-syn match swayConfigXkbOptsPair /[a-z]\+:[0-9a-z_-]\+/ contained contains=swayConfigXkbOptsPairVal
-syn match swayConfigInputXkbOpts /xkb_options \([a-z]\+:[0-9a-z_-]\+,\?\)\+/ contained contains=swayConfigXkbOptsPair,swayConfigDeviceOps
-syn region i3ConfigAction start=/input/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=swayConfigInputStart,swayConfigInputXkbOpts,swayConfigInputOpts,swayConfigInputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigBoolean,swayConfigDeviceOps keepend transparent
-syn region i3ConfigInput start=/^input/ skip=/\\$/ end=/$/ contains=swayConfigInputStart,swayConfigInputXkbOpts,swayConfigInputOpts,swayConfigInputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigBoolean,swayConfigDeviceOps keepend
-syn region i3ConfigInput start=/^input .* {/ end=/}$/ contains=swayConfigInputStart,swayConfigInputXkbOpts,swayConfigInputOpts,swayConfigInputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigBoolean,swayConfigDeviceOps,i3ConfigParen keepend extend
+syn keyword swayConfigInputOpts xkb_variant xkb_rules xkb_switch_layout xkb_numlock xkb_file xkb_capslock xkb_model repeat_delay repeat_rate map_to_output map_to_region map_from_region tool_mode accel_profile dwt dwtp drag_lock drag click_method middle_emulation tap events calibration_matrix natural_scroll left_handed pointer_accel scroll_button scroll_factor scroll_method tap_button_map contained skipwhite nextgroup=swayConfigInputOptVals,@i3ConfigValue
+syn keyword swayConfigInputOptVals absolute relative adaptive flat none button_areas clickfinger toggle two_finger edge on_button_down lrm lmr next prev pen eraser brush pencil airbrush disabled_on_external_mouse disable enable contained skipwhite nextgroup=swayConfigInputOpts,@i3ConfigValue,swayConfigDeviceOper
+syn match swayConfigDeviceOper /,/ contained nextgroup=swayConfigXkbOptsPair,swayConfigXkbLayout
+syn match swayConfigXkbLayout /[a-z]\+/ contained nextgroup=swayConfigDeviceOper
+syn keyword swayConfigInputOpts xkb_layout contained skipwhite nextgroup=swayConfigXkbLayout
+syn match swayConfigXkbOptsPairVal /[0-9a-z_-]\+/ contained contains=i3ConfigNumber skipwhite nextgroup=swayConfigDeviceOper,swayConfigInputOpts
+syn match swayConfigXkbOptsPair /[a-z]\+:/ contained contains=i3ConfigColonOperator nextgroup=swayConfigXkbOptsPairVal
+syn keyword swayConfigInputOpts xkb_options contained skipwhite nextgroup=swayConfigXkbOptsPair
+
+syn region swayConfigInput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigInputOpts,@i3ConfigValue keepend
+syn region swayConfigInput matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigInputOpts,@i3ConfigValue,i3ConfigComment keepend extend
+syn keyword swayConfigInputType touchpad pointer keyboard touch tablet_tool tablet_pad switch contained nextgroup=swayConfigInput
+syn match swayConfigInputIdent /type:!\?/ contained contains=swayConfigDeviceOper nextgroup=swayConfigInputType
+syn match swayConfigInputIdent /[^t '"]\S*/ contained contains=i3ConfigOutputIdent nextgroup=swayConfigInput
+syn region swayConfigInputIdent start=/['"]/ end=/\ze/ contained contains=i3ConfigOutputIdent nextgroup=swayConfigInput
+syn keyword i3ConfigKeyword input contained skipwhite nextgroup=swayConfigInputIdent
 
 " Seat
-syn keyword swayConfigSeatKeyword seat contained
-syn keyword swayConfigSeatOpts attach cursor fallback hide_cursor idle_inhibit idle_wake keyboard_grouping shortcuts_inhibitor pointer_constraint xcursor_theme contained
-syn match swayConfigSeatOptVals /when-typing/ contained
-syn keyword swayConfigSeatOptVals move set press release none smart activate deactivate toggle escape enable disable contained
-syn region i3ConfigAction start=/seat/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=swayConfigSeatKeyword,i3ConfigString,i3ConfigNumber,i3ConfigBoolean,swayConfigSeatOptVals,swayConfigSeatOpts,swayConfigDeviceOps,swayConfigInputType keepend transparent
-syn region swayConfigSeat start=/seat/ skip=/\\$/ end=/$/ contains=swayConfigSeatKeyword,i3ConfigString,i3ConfigNumber,i3ConfigBoolean,swayConfigSeatOptVals,swayConfigSeatOpts,swayConfigDeviceOps,swayConfigInputType keepend
-syn region swayConfigSeat start=/seat .* {$/ end=/}$/ contains=swayConfigSeatKeyword,i3ConfigString,i3ConfigNumber,i3ConfigBoolean,swayConfigSeatOptVals,swayConfigSeatOpts,swayConfigDeviceOps,i3ConfigParen,swayConfigInputType keepend extend
+syn keyword swayConfigSeatOpts cursor fallback hide_cursor keyboard_grouping shortcuts_inhibitor pointer_constraint xcursor_theme contained skipwhite nextgroup=swayConfigSeatOptVals,@i3ConfigValue
+syn match swayConfigInputTypeSeq / \w\+/ contained contains=swayConfigInputType nextgroup=swayConfigInputTypeSeq,swayConfigSeatOpts
+syn keyword swayConfigSeatOpts idle_inhibit idle_wake contained nextgroup=swayConfigInputTypeSeq
+syn keyword swayConfigSeatOpts attach contained skipwhite nextgroup=swayConfigSeatIdent
+syn match swayConfigSeatOptVals /when-typing/ contained skipwhite nextgroup=swayConfigSeatOptVals
+syn keyword swayConfigSeatOptVals move set press release none smart activate deactivate toggle escape enable disable contained skipwhite nextgroup=swayConfigSeatOpts
+syn region swayConfigSeat start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigSeatOpts,@i3ConfigValue keepend
+syn region swayConfigSeat matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigSeatOpts,@i3ConfigValue,i3ConfigComment keepend extend
+syn match swayConfigSeatIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent skipwhite nextgroup=swayConfigSeat
+syn keyword i3ConfigKeyword seat contained skipwhite nextgroup=swayConfigSeatIdent
 
 " Output monitors
-syn keyword swayConfigOutputKeyword output contained
-syn keyword swayConfigOutputOpts mode resolution res modeline position pos scale scale_filter subpixel background bg transform disable enable power dpms max_render_time adaptive_sync render_bit_depth contained
-syn keyword swayConfigOutputOptVals linear nearest smart rgb bgr vrgb vbgr none normal flipped fill stretch fit center tile solid_color clockwise anticlockwise toggle contained
-syn match swayConfigOutputOptVals /--custom\|flipped-\(90\|180\|270\)/ contained
-syn match swayConfigOutputFPS /@[0-9.]\+Hz/ contained
-syn match swayConfigOutputMode / [0-9]\+x[0-9]\+\(@[0-9.]\+Hz\)\?/ contained contains=swayConfigOutputFPS
-syn region i3ConfigAction start=/output/ skip=/\\$/ end=/\([,;]\|$\)/ contained contains=swayConfigOutputKeyword,swayConfigOutputMode,swayConfigOutputOpts,swayConfigOutputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigString,i3ConfigColor,i3ConfigBoolean,swayConfigDeviceOps keepend transparent
-syn region swayConfigOutput start=/^output/ skip=/\\$/ end=/$/  contains=swayConfigOutputKeyword,swayConfigOutputMode,swayConfigOutputOpts,swayConfigOutputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigString,i3ConfigColor,i3ConfigBoolean,swayConfigDeviceOps keepend
-syn region swayConfigOutput start=/^output .* {$/ end=/}$/  contains=swayConfigOutputKeyword,swayConfigOutputMode,swayConfigOutputOpts,swayConfigOutputOptVals,i3ConfigVariable,i3ConfigNumber,i3ConfigString,i3ConfigColor,i3ConfigBoolean,swayConfigDeviceOps,i3ConfigParen keepend extend
+syn keyword swayConfigOutputOpts mode resolution res modeline position pos scale scale_filter subpixel transform disable enable power dpms max_render_time adaptive_sync render_bit_depth contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue,swayConfigOutputMode
+syn keyword swayConfigOutputOptVals linear nearest smart rgb bgr vrgb vbgr none clockwise anticlockwise toggle contained skipwhite nextgroup=swayConfigOutputOptVals,@i3ConfigValue
+syn keyword swayConfigOutputBgVals solid_color fill stretch fit center tile contained skipwhite nextgroup=@i3ConfigColVar
+syn match swayConfigOutputBg /[#$]\S\+ solid_color/ contained contains=@i3ConfigColVar,swayConfigOutputBgVals
+syn match swayConfigOutputBg /[^b# '"]\S*/ contained contains=i3ConfigShOper skipwhite nextgroup=swayConfigOutputBgVals
+syn region swayConfigOutputBg start=/['"]/ end=/\ze/ contained contains=@i3ConfigIdent skipwhite nextgroup=swayConfigOutputBgVals
+syn keyword swayConfigOutputOpts bg background contained skipwhite nextgroup=swayConfigOutputBg
+syn match swayConfigOutputFPS /@[0-9.]\+Hz/ contained skipwhite nextgroup=swayConfigOutputOpts
+syn match swayConfigOutputMode /\(--custom \)\?[0-9]\+x[0-9]\+/ contained contains=i3ConfigShParam skipwhite nextgroup=swayConfigOutputFPS,swayConfigOutputOpts
+syn match swayConfigOutputOptVals /\(flipped-\)\?\(90\|180\|270\)\|flipped\|normal/ contained contains=i3ConfigNumber skipwhite nextgroup=swayConfigOutputOptsVals
+syn region swayConfigOutput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigOutputOpts,@i3ConfigValue keepend
+syn region swayConfigOutput matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigOutputOpts,@i3ConfigValue,i3ConfigComment keepend extend
+syn match swayConfigOutputIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent skipwhite nextgroup=swayConfigOutput
+syn keyword i3ConfigKeyword output contained skipwhite nextgroup=swayConfigOutputIdent
 
 " Define the highlighting.
-hi def link swayConfigSmartGapsOpts          i3ConfigOption
 hi def link swayConfigFloatingModifierOpts   i3ConfigOption
-hi def link swayConfigFocusFollowsMouseOpts  i3ConfigOption
-hi def link swayConfigBindKeyword            i3ConfigBindKeyword
 hi def link swayConfigXOpt                   i3ConfigOption
-hi def link swayConfigInhibitKeyword         i3ConfigCommand
 hi def link swayConfigInhibitOpts            i3ConfigOption
 hi def link swayConfigBindswitchArgument     i3ConfigBindArgument
 hi def link swayConfigBindswitchType         i3ConfigMoveType
@@ -137,20 +141,18 @@ hi def link swayConfigBindswitchState        i3ConfigMoveDir
 hi def link swayConfigBindgestureArgument    i3ConfigBindArgument
 hi def link swayConfigBindgestureType        i3ConfigMoveType
 hi def link swayConfigBindgestureDir         i3ConfigMoveDir
-hi def link swayConfigDeviceOps              i3ConfigOperator
-hi def link swayConfigInputKeyword           i3ConfigCommand
+hi def link swayConfigDeviceOper             i3ConfigOperator
 hi def link swayConfigInputType              i3ConfigMoveType
-hi def link swayConfigInputTypePair          i3ConfigMoveDir
+hi def link swayConfigInputIdent             i3ConfigMoveDir
 hi def link swayConfigInputOptVals           i3ConfigShParam
 hi def link swayConfigInputOpts              i3ConfigOption
-hi def link swayConfigXkbOptsPairVal         i3ConfigString
+hi def link swayConfigXkbOptsPairVal         i3ConfigParamLine
 hi def link swayConfigXkbOptsPair            i3ConfigShParam
-hi def link swayConfigInputXkbOpts           i3ConfigOption
-hi def link swayConfigSeatKeyword            i3ConfigCommand
+hi def link swayConfigXkbLayout              i3ConfigParamLine
 hi def link swayConfigSeatOptVals            swayConfigInputOptVals
 hi def link swayConfigSeatOpts               swayConfigInputOpts
-hi def link swayConfigOutputKeyword          i3ConfigCommand
 hi def link swayConfigOutputOptVals          swayConfigInputOptVals
+hi def link swayConfigOutputBgVals           swayConfigInputOptVals
 hi def link swayConfigOutputOpts             swayConfigInputOpts
 hi def link swayConfigOutputFPS              Constant
 hi def link swayConfigOutputMode             i3ConfigNumber
-- 
cgit 


From 537ba3495323a0dad555dbe2c7e08667c5d467e9 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 16 Apr 2024 09:32:55 +0800
Subject: vim-patch:4052474a1bd2 (#28358)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

runtime(java): Recognise non-ASCII identifiers (vim/vim#14543)

* runtime(java): Recognise non-ASCII identifiers

Also:

- Remove the already commented out and less general in its
  definition javaFuncDef alternative.

- Stop recognising some bespoke {p,trace} debugging API.

Non-ASCII identifiers have been supported from the outset
of the Java language.

> An _identifier_ is an unlimited-length sequence of _Java
> letters_ and _Java digits_, the first of which must be a
> Java letter.  An identifier cannot have the same spelling
> (Unicode character sequence) as a keyword . . . Boolean
> literal . . . or the null literal . . .
> . . . . . . . .
> Letters and digits may be drawn from the entire Unicode
> character set . . .
> . . . . . . . .
> A Java letter is a character for which the method
> Character.isJavaLetter . . . returns true.  A Java
> letter-or-digit is a character for which the method
> Character.isJavaLetterOrDigit . . . returns true.
> . . . . . . . .
> The Java letters include . . . for historical reasons, the
> ASCII underscore (_) . . . and dollar sign ($) . . .

(Separate syntax tests will be written when particular parts
now touched will have been further improved.)

Reference:
https://javaalmanac.io/jdk/1.0/langspec.pdf [§3.8]

* Take on the maintenance of Java filetype and syntax files

https://github.com/vim/vim/commit/4052474a1bd2fe756bc7dc596d29d0d7581e35ae

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
---
 runtime/syntax/java.vim | 53 +++++++++++++++++++++++++++++--------------------
 1 file changed, 31 insertions(+), 22 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index 22fc934a0c..e85174e7b0 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -1,8 +1,9 @@
 " Vim syntax file
-" Language:	Java
-" Maintainer:	Claudio Fleiner 
-" URL:          https://github.com/fleiner/vim/blob/master/runtime/syntax/java.vim
-" Last Change:	2024 Apr 04
+" Language:		Java
+" Maintainer:		Aliaksei Budavei <0x000c70 AT gmail DOT com>
+" Former Maintainer:	Claudio Fleiner 
+" Repository:		https://github.com/zzzyxwvut/java-vim.git
+" Last Change:		2024 Apr 13
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -63,7 +64,7 @@ syn match   javaClassDecl	"\\%(\s*(\)\@!"
 syn match   javaClassDecl	"\\%(\s*(\)\@!"
 syn match   javaClassDecl	"^class\>"
 syn match   javaClassDecl	"[^.]\s*\"ms=s+1
-syn match   javaAnnotation	"@\([_$a-zA-Z][_$a-zA-Z0-9]*\.\)*[_$a-zA-Z][_$a-zA-Z0-9]*\>" contains=javaString
+syn match   javaAnnotation	"@\%(\K\k*\.\)*\K\k*\>"
 syn match   javaClassDecl	"@interface\>"
 syn keyword javaBranch		break continue nextgroup=javaUserLabelRef skipwhite
 syn match   javaUserLabelRef	"\k\+" contained
@@ -288,18 +289,24 @@ syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpe
 
 if exists("java_highlight_functions")
   if java_highlight_functions == "indent"
-    syn match  javaFuncDef "^\(\t\| \{8\}\)[_$a-zA-Z][_$a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
-    syn region javaFuncDef start=+^\(\t\| \{8\}\)[$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
-    syn match  javaFuncDef "^  [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*)" contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
-    syn region javaFuncDef start=+^  [$_a-zA-Z][$_a-zA-Z0-9_. \[\]<>]*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
+    syn match javaFuncDef "^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*)" contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
+    syn region javaFuncDef start=+^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
   else
-    " This line catches method declarations at any indentation>0, but it assumes
-    " two things:
-    "	1. class names are always capitalized (ie: Button)
-    "	2. method names are never capitalized (except constructors, of course)
-    "syn region javaFuncDef start=+^\s\+\(\(public\|protected\|private\|static\|abstract\|final\|native\|synchronized\)\s\+\)*\(\(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\(<[^>]*>\)\=\(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*([^0-9]+ end=+)+ contains=javaScopeDecl,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses
-    syn region javaFuncDef start=+^\s\+\%(\%(public\|protected\|private\|static\|\%(abstract\|default\)\|final\|native\|synchronized\)\s\+\)*\%(<.*>\s\+\)\?\%(\%(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\%([A-Za-z_][A-Za-z0-9_$]*\.\)*[A-Z][A-Za-z0-9_$]*\)\%(<[^(){}]*>\)\=\%(\[\]\)*\s\+[a-z][A-Za-z0-9_$]*\|[A-Z][A-Za-z0-9_$]*\)\s*(+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation
+    " This is the "style" variant (:help ft-java-syntax).
+    "
+    " Match arbitrarily indented method and constructor declarations
+    " and some enum constants.
+    "
+    " TODO: Come back to refine and fix the parts of javaFuncDef.
+    " TODO: Request the new regexp engine for [:upper:] and [:lower:].
+    "
+    " XXX: \C\<[^a-z0-9]\k*\> rejects "type", but matches "τύπος".
+    " XXX: \C\<[^A-Z0-9]\k*\> rejects "Method", but matches "Μέθοδος".
+    "
+    " Match: [abstract] [<α, β>] [Τʬ][<γ>][[][]] [μΜ]ʭʭ(/* ... */);
+    syn region javaFuncDef start=+^\s\+\%(\%(public\|protected\|private\|static\|\%(abstract\|default\)\|final\|native\|synchronized\)\s\+\)*\%(<.*>\s\+\)\=\%(\%(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\%(\K\k*\.\)*\<[^a-z0-9]\k*\>\)\%(<[^(){}]*>\)\=\%(\[\]\)*\s\+\<[^A-Z0-9]\k*\>\|\<[^a-z0-9]\k*\>\)\s*(+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation
   endif
+
   syn match   javaLambdaDef "\<\K\k*\>\%(\\)\@"
   syn match  javaBraces  "[{}]"
   syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef
@@ -332,11 +339,13 @@ if exists("java_highlight_debug")
   syn keyword javaDebugType		contained null this super
   syn region javaDebugParen  start=+(+ end=+)+ contained contains=javaDebug.*,javaDebugParen
 
-  " to make this work you must define the highlighting for these groups
-  syn match javaDebug "\\[\], \t]*)\s*->"
-   " needs to be defined after the parenthesis error catcher to work
+  " Make ()-matching definitions after the parenthesis error catcher.
+  syn match javaLambdaDef "\k\@4?\[\]@,.]\)*)\s*->"
 endif
 
 if !exists("java_minlines")
-- 
cgit 


From 07661009c59e1cf70270d16ecb5f61f5c360d56a Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 16 Apr 2024 09:33:16 +0800
Subject: vim-patch:9.1.0325: CMakeCache.txt files not recognized (#28359)

vim-patch:9.1.0325: filetype: CMakeCache.txt files not recognized

Problem:  filetype: CMakeCache.txt files not recognized
Solution: Detect 'CMakeCache.txt' files as cmakecache filetype,
          include basic syntax script for cmakecache
          (Wu, Zhenyu, @bfrg)

closes: vim/vim#14384

https://github.com/vim/vim/commit/62c09e032c6b2d49fffac726300d142381924b98

Co-authored-by: Wu, Zhenyu 
Co-authored-by: bfrg 
---
 runtime/syntax/cmakecache.vim | 60 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 runtime/syntax/cmakecache.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/cmakecache.vim b/runtime/syntax/cmakecache.vim
new file mode 100644
index 0000000000..f07c719811
--- /dev/null
+++ b/runtime/syntax/cmakecache.vim
@@ -0,0 +1,60 @@
+" Vim syntax file
+" Language:     cmakecache - CMakeCache.txt files generated by CMake
+" Author:       bfrg 
+" Upstream:      https://github.com/bfrg/vim-cmakecache-syntax
+" Last Change:  Nov 28, 2019
+" License:      Same as Vim itself (see :h license)
+
+if exists('b:current_syntax')
+    finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+" Comments start with # or //
+syntax region CMakeCacheComment start="#\|//" end="$"
+
+" Match 'key' in key:type=value
+syntax match CMakeCacheKey "^\s*\w\+\(-ADVANCED\)\=:"me=e-1
+
+" Highlight 'str' in key:STRING=str (many thanks to Nickspoons in #vim!)
+syntax region CMakeCacheStringVar   matchgroup=CMakeCacheType start=":STRING="ms=s+1,rs=e-1 end="$" contains=CMakeCacheString keepend
+syntax region CMakeCacheString      start="="ms=s+1 end="$" contained
+
+" Highlight boolean 'value' in key:BOOL=value
+syntax region CMakeCacheBoolVar     matchgroup=CMakeCacheType start=":BOOL="ms=s+1,rs=e-1 end="$" contains=CMakeCacheBool keepend
+syntax region CMakeCacheBool        start="="ms=s+1 end="$" contained
+
+" Highlight 'path' in key:PATH=path
+syntax region CMakeCachePathVar     matchgroup=CMakeCacheType start=":PATH="ms=s+1,rs=e-1 end="$" contains=CMakeCachePath keepend
+syntax region CMakeCachePath        start="="ms=s+1 end="$" contained
+
+" Highlight 'file' in key:FILEPATH=file
+syntax region CMakeCacheFilePathVar matchgroup=CMakeCacheType start=":FILEPATH="ms=s+1,rs=e-1 end="$" contains=CMakeCacheFilePath keepend
+syntax region CMakeCacheFilePath    start="="ms=s+1 end="$" contained
+
+" Highlight 'value' in key:STATIC=value
+syntax region CMakeCacheStaticVar   matchgroup=CMakeCacheType start=":STATIC="ms=s+1,rs=e-1 end="$" contains=CMakeCacheStatic keepend
+syntax region CMakeCacheStatic      start="="ms=s+1 end="$" contained
+
+" Highlight 'value' in key:Internal=value
+syntax region CMakeCacheInternalVar matchgroup=CMakeCacheType start=":INTERNAL="ms=s+1,rs=e-1 end="$" contains=CMakeCacheInternal keepend
+syntax region CMakeCacheInternal    start="="ms=s+1 end="$" contained
+
+hi def link CMakeCacheComment   Comment
+hi def link CMakeCacheKey       Identifier
+hi def link CMakeCacheString    String
+hi def link CMakeCacheBool      Constant
+hi def link CMakeCachePath      Directory
+hi def link CMakeCacheFilePath  Normal
+hi def link CMakeCacheStatic    Normal
+hi def link CMakeCacheInternal  Normal
+
+" Highlight 'type' in key:type=value
+hi def link CMakeCacheType      Type
+
+let b:current_syntax = 'cmakecache'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
-- 
cgit 


From fb7ffac69fe4a32abfb4abfe5cf36213da17904d Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Tue, 16 Apr 2024 09:33:33 +0800
Subject: vim-patch:9.1.0326: filetype: some requirements files are not
 recognized (#28360)

Problem:  filetype: some requirements files are not recognized
Solution: Detect '*-requirements.txt', 'constraints.txt',
          'requirements.in', 'requirements/*.txt' and 'requires/*.txt'
          as requirements filetype, include pip compiler, include
          requirements filetype and syntax plugin
          (Wu, Zhenyu, @raimon49)

closes: vim/vim#14379

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

Co-authored-by: Wu, Zhenyu 
Co-authored-by: raimon 
---
 runtime/syntax/requirements.vim | 67 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 67 insertions(+)
 create mode 100644 runtime/syntax/requirements.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/requirements.vim b/runtime/syntax/requirements.vim
new file mode 100644
index 0000000000..a87d1e9a39
--- /dev/null
+++ b/runtime/syntax/requirements.vim
@@ -0,0 +1,67 @@
+" the Requirements File Format syntax support for Vim
+" Version: 1.8.0
+" Author:  raimon 
+" Upstream: https://github.com/raimon49/requirements.txt.vim
+" License: MIT LICENSE
+" The MIT License (MIT)
+"
+" Copyright (c) 2015 raimon
+"
+" Permission is hereby granted, free of charge, to any person obtaining a copy
+" of this software and associated documentation files (the "Software"), to deal
+" in the Software without restriction, including without limitation the rights
+" to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+" copies of the Software, and to permit persons to whom the Software is
+" furnished to do so, subject to the following conditions:
+"
+" The above copyright notice and this permission notice shall be included in all
+" copies or substantial portions of the Software.
+"
+" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+" AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+" OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+" SOFTWARE.
+
+if exists("b:current_syntax") && b:current_syntax == "requirements"
+    finish
+endif
+
+syn case match
+
+" https://pip.pypa.io/en/stable/reference/requirements-file-format/
+" https://pip.pypa.io/en/stable/reference/inspect-report/#example
+syn keyword requirementsKeyword implementation_name implementation_version os_name platform_machine platform_release platform_system platform_version python_full_version platform_python_implementation python_version sys_platform contained
+syn region requirementsSubst matchgroup=requirementsSubstDelim start="\V${" end="\V}"
+syn region requirementsString matchgroup=requirementsStringDelim start=`'` skip=`\\'` end=`'`
+syn region requirementsString matchgroup=requirementsStringDelim start=`"` skip=`\\"` end=`"`
+syn match requirementsVersion "\v\d+[a-zA-Z0-9\.\-\*]*"
+syn region requirementsComment start="[ \t]*#" end="$"
+syn match requirementsCommandOption "\v^\[?--?[a-zA-Z\-]*\]?"
+syn match requirementsVersionSpecifiers "\v(\=\=\=?|\<\=?|\>\=?|\~\=|\!\=)"
+syn match requirementsPackageName "\v^([a-zA-Z0-9][a-zA-Z0-9\-_\.]*[a-zA-Z0-9])"
+syn match requirementsExtras "\v\[\S+\]"
+syn match requirementsVersionControls "\v(git\+?|hg\+|svn\+|bzr\+).*://.\S+"
+syn match requirementsURLs "\v(\@\s)?(https?|ftp|gopher)://?[^\s/$.?#].\S*"
+syn match requirementsEnvironmentMarkers "\v;\s[^#]+" contains=requirementsKeyword,requirementsVersionSpecifiers,requirementsString
+
+hi def link requirementsKeyword Keyword
+hi def link requirementsSubstDelim Delimiter
+hi def link requirementsSubst PreProc
+hi def link requirementsStringDelim Delimiter
+hi def link requirementsString String
+hi def link requirementsVersion Number
+hi def link requirementsComment Comment
+hi def link requirementsCommandOption Special
+hi def link requirementsVersionSpecifiers Boolean
+hi def link requirementsPackageName Identifier
+hi def link requirementsExtras Type
+hi def link requirementsVersionControls Underlined
+hi def link requirementsURLs Underlined
+hi def link requirementsEnvironmentMarkers Macro
+
+let b:current_syntax = "requirements"
+
+" vim: et sw=4 ts=4 sts=4:
-- 
cgit 


From 8d77061051d3d5e7b0eb067a0bf776f2c62a7133 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Fri, 19 Apr 2024 14:50:12 +0800
Subject: vim-patch:9.1.0354: runtime(uci): No support for uci file types
 (#28409)

Problem:  runtime(uci): No support for uci file types
          (Wu, Zhenyu)
Solution: include basic uci ftplugin and syntax plugins
          (Colin Caine)

closes: vim/vim#14575

https://github.com/vim/vim/commit/4b3fab14dbde971f15d8783e9ef125b19fdbc829

Co-authored-by: Colin Caine 
Co-authored-by: Wu, Zhenyu 
---
 runtime/syntax/uci.vim | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 runtime/syntax/uci.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/uci.vim b/runtime/syntax/uci.vim
new file mode 100644
index 0000000000..fdf5bfd9b3
--- /dev/null
+++ b/runtime/syntax/uci.vim
@@ -0,0 +1,33 @@
+" Vim syntax file
+" Language:	OpenWrt Unified Configuration Interface
+" Maintainer:	Colin Caine 
+" Upstream:	https://github.com/cmcaine/vim-uci
+" Last Change:	2021 Sep 19
+"
+" For more information on uci, see https://openwrt.org/docs/guide-user/base-system/uci
+
+if exists("b:current_syntax")
+    finish
+endif
+
+" Fancy zero-width non-capturing look-behind to see what the last word was.
+" Would be really nice if there was some less obscure or more efficient way to
+" do this.
+syntax match uciOptionName '\%(\%(option\|list\)\s\+\)\@<=\S*'
+syntax match uciConfigName '\%(\%(package\|config\)\s\+\)\@<=\S*'
+syntax keyword uciConfigDec package config nextgroup=uciConfigName skipwhite
+syntax keyword uciOptionType option list nextgroup=uciOptionName skipwhite
+
+" Standard matches.
+syntax match uciComment "#.*$"
+syntax region uciString start=+"+ end=+"+ skip=+\\"+
+syntax region uciString start=+'+ end=+'+ skip=+\\'+
+
+highlight default link uciConfigName Identifier
+highlight default link uciOptionName Constant
+highlight default link uciConfigDec Statement
+highlight default link uciOptionType Type
+highlight default link uciComment Comment
+highlight default link uciString Normal
+
+let b:current_syntax = "uci"
-- 
cgit 


From 7b8e582f1ce3ba604eb03418ee8366f74496ad3e Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sun, 21 Apr 2024 16:06:29 +0200
Subject: vim-patch:d3ff129ce8c6

runtime(astro): Add filetype, syntax and indent plugin

related: vim/vim#14558
closes: vim/vim#14561

ported from: https://github.com/wuelnerdotexe/vim-astro

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

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
---
 runtime/syntax/astro.vim | 190 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 190 insertions(+)
 create mode 100644 runtime/syntax/astro.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/astro.vim b/runtime/syntax/astro.vim
new file mode 100644
index 0000000000..0816051ada
--- /dev/null
+++ b/runtime/syntax/astro.vim
@@ -0,0 +1,190 @@
+" Vim syntax file.
+" Language:    Astro
+" Author:      Wuelner Martínez 
+" Maintainer:  Wuelner Martínez 
+" URL:         https://github.com/wuelnerdotexe/vim-astro
+" Last Change: 2022 Aug 22
+" Based On:    Evan Lecklider's vim-svelte
+" Changes:     See https://github.com/evanleck/vim-svelte
+" Credits:     See vim-svelte on github
+
+" Quit when a (custom) syntax file was already loaded.
+if !exists('main_syntax')
+  if exists('b:current_syntax')
+    finish
+  endif
+  let main_syntax = 'astro'
+elseif exists('b:current_syntax') && b:current_syntax == 'astro'
+  finish
+endif
+
+" Astro syntax variables are initialized.
+let g:astro_typescript = get(g:, 'astro_typescript', 'disable')
+let g:astro_stylus = get(g:, 'astro_stylus', 'disable')
+
+let s:cpoptions_save = &cpoptions
+set cpoptions&vim
+
+" Embedded HTML syntax.
+runtime! syntax/html.vim
+
+" htmlTagName: expand HTML tag names to include mixed case and periods.
+syntax match htmlTagName contained "\<[a-zA-Z\.]*\>"
+
+" astroDirectives: add Astro Directives to HTML arguments.
+syntax match astroDirectives contained '\<[a-z]\+:[a-z|]*\>' containedin=htmlTag
+
+unlet b:current_syntax
+
+if g:astro_typescript == 'enable'
+  " Embedded TypeScript syntax.
+  syntax include @astroJavaScript syntax/typescript.vim
+
+  " javaScriptExpression: a javascript expression is used as an arg value.
+  syntax clear javaScriptExpression
+  syntax region javaScriptExpression
+        \ contained start=+&{+
+        \ keepend end=+};+
+        \ contains=@astroJavaScript,@htmlPreproc
+
+  " javaScript: add TypeScript support to HTML script tag.
+  syntax clear javaScript
+  syntax region javaScript
+        \ start=+]*>+
+        \ keepend
+        \ end=+]*>+me=s-1
+        \ contains=htmlScriptTag,@astroJavaScript,@htmlPreproc,htmlCssStyleComment
+else
+  " Embedded JavaScript syntax.
+  syntax include @astroJavaScript syntax/javascript.vim
+endif
+
+" astroFence: detect the Astro fence.
+syntax match astroFence contained +^---$+
+
+" astrojavaScript: add TypeScript support to Astro code fence.
+syntax region astroJavaScript
+      \ start=+^---$+
+      \ keepend
+      \ end=+^---$+
+      \ contains=htmlTag,@astroJavaScript,@htmlPreproc,htmlCssStyleComment,htmlEndTag,astroFence
+      \ fold
+
+unlet b:current_syntax
+
+if g:astro_typescript == 'enable'
+  " Embedded TypeScript React (TSX) syntax.
+  syntax include @astroJavaScriptReact syntax/typescriptreact.vim
+else
+  " Embedded JavaScript React (JSX) syntax.
+  syntax include @astroJavaScriptReact syntax/javascriptreact.vim
+endif
+
+" astroJavaScriptExpression: add {JSX or TSX} support to Astro expresions.
+execute 'syntax region astroJavaScriptExpression start=+{+ keepend end=+}+ ' .
+      \ 'contains=@astroJavaScriptReact, @htmlPreproc containedin=' . join([
+      \   'htmlArg', 'htmlBold', 'htmlBoldItalic', 'htmlBoldItalicUnderline',
+      \   'htmlBoldUnderline', 'htmlBoldUnderlineItalic', 'htmlH1', 'htmlH2',
+      \   'htmlH3', 'htmlH4', 'htmlH5', 'htmlH6', 'htmlHead', 'htmlItalic',
+      \   'htmlItalicBold', 'htmlItalicBoldUnderline', 'htmlItalicUnderline',
+      \   'htmlItalicUnderlineBold', 'htmlLeadingSpace', 'htmlLink',
+      \   'htmlStrike', 'htmlString', 'htmlTag', 'htmlTitle', 'htmlUnderline',
+      \   'htmlUnderlineBold', 'htmlUnderlineBoldItalic',
+      \   'htmlUnderlineItalic', 'htmlUnderlineItalicBold', 'htmlValue'
+      \ ], ',')
+
+" cssStyle: add CSS style tags support in TypeScript React.
+syntax region cssStyle
+      \ start=+]*>+
+      \ keepend
+      \ end=+]*>+me=s-1
+      \ contains=htmlTag,@htmlCss,htmlCssStyleComment,@htmlPreproc,htmlEndTag
+      \ containedin=@astroJavaScriptReact
+
+unlet b:current_syntax
+
+" Embedded SCSS syntax.
+syntax include @astroScss syntax/scss.vim
+
+" cssStyle: add SCSS style tags support in Astro.
+syntax region scssStyle
+      \ start=/\_[^>]*\(lang\)=\("\|''\)[^\2]*scss[^\2]*\2\_[^>]*>/
+      \ keepend
+      \ end=++me=s-1
+      \ contains=@astroScss,astroSurroundingTag
+      \ fold
+
+unlet b:current_syntax
+
+" Embedded SASS syntax.
+syntax include @astroSass syntax/sass.vim
+
+" cssStyle: add SASS style tags support in Astro.
+syntax region sassStyle
+      \ start=/\_[^>]*\(lang\)=\("\|''\)[^\2]*sass[^\2]*\2\_[^>]*>/
+      \ keepend
+      \ end=++me=s-1
+      \ contains=@astroSass,astroSurroundingTag
+      \ fold
+
+unlet b:current_syntax
+
+" Embedded LESS syntax.
+syntax include @astroLess syntax/less.vim
+
+" cssStyle: add LESS style tags support in Astro.
+syntax region lessStyle
+      \ start=/\_[^>]*\(lang\)=\("\|''\)[^\2]*less[^\2]*\2\_[^>]*>/
+      \ keepend
+      \ end=++me=s-1
+      \ contains=@astroLess,astroSurroundingTag
+      \ fold
+
+unlet b:current_syntax
+
+" Embedded Stylus syntax.
+" NOTE: Vim does not provide stylus support by default, but you can install
+"       this plugin to support it: https://github.com/wavded/vim-stylus
+if g:astro_stylus == 'enable'
+  try
+    " Embedded Stylus syntax.
+    syntax include @astroStylus syntax/stylus.vim
+
+    " stylusStyle: add Stylus style tags support in Astro.
+    syntax region stylusStyle
+          \ start=/\_[^>]*\(lang\)=\("\|''\)[^\2]*stylus[^\2]*\2\_[^>]*>/
+          \ keepend
+          \ end=++me=s-1
+          \ contains=@astroStylus,astroSurroundingTag
+          \ fold
+
+    unlet b:current_syntax
+  catch
+    echomsg "you need install a external plugin for support stylus in .astro files"
+  endtry
+endif
+
+" astroSurroundingTag: add surround HTML tag to script and style.
+syntax region astroSurroundingTag
+      \ start=+<\(script\|style\)+
+      \ end=+>+
+      \ contains=htmlTagError,htmlTagN,htmlArg,htmlValue,htmlEvent,htmlString
+      \ contained
+      \ fold
+
+" Define the default highlighting.
+" Only used when an item doesn't have highlighting yet.
+highlight default link astroDirectives Special
+highlight default link astroFence Comment
+
+let b:current_syntax = 'astro'
+if main_syntax == 'astro'
+  unlet main_syntax
+endif
+
+" Sync from start because of the wacky nesting.
+syntax sync fromstart
+
+let &cpoptions = s:cpoptions_save
+unlet s:cpoptions_save
+" vim: ts=8
-- 
cgit 


From aef120d1e94e83a367a631d6bc8ce0b4a64f9dbd Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 22 Apr 2024 23:41:31 +0200
Subject: vim-patch:9.1.0366: filetype: ondir files are not recognized

Problem:  filetype: ondir files are not recognized
Solution: Detect '.ondirrc' as ondir filetype
          (Jon Parise)

closes: vim/vim#14604

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

Co-authored-by: Jon Parise 
---
 runtime/syntax/ondir.vim | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 runtime/syntax/ondir.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/ondir.vim b/runtime/syntax/ondir.vim
new file mode 100644
index 0000000000..4aeb014e1b
--- /dev/null
+++ b/runtime/syntax/ondir.vim
@@ -0,0 +1,35 @@
+" Vim syntax file
+" Language:     ondir 
+" Maintainer:   Jon Parise 
+
+if exists('b:current_syntax')
+  finish
+endif
+
+let s:cpo_save = &cpoptions
+set cpoptions&vim
+
+syn case match
+
+syn match   ondirComment  "#.*" contains=@Spell
+syn keyword ondirKeyword  final contained skipwhite nextgroup=ondirKeyword
+syn keyword ondirKeyword  enter leave contained skipwhite nextgroup=ondirPath
+syn match   ondirPath     "[^:]\+" contained display
+syn match   ondirColon    ":" contained display
+
+syn include @ondirShell   syntax/sh.vim
+syn region  ondirContent  start="^\s\+" end="^\ze\S.*$" keepend contained contains=@ondirShell
+
+syn region  ondirSection  start="^\(final\|enter\|leave\)" end="^\ze\S.*$" fold contains=ondirKeyword,ondirPath,ondirColon,ondirContent
+
+hi def link ondirComment  Comment
+hi def link ondirKeyword  Keyword
+hi def link ondirPath     Special
+hi def link ondirColon    Operator
+
+let b:current_syntax = 'ondir'
+
+let &cpoptions = s:cpo_save
+unlet s:cpo_save
+
+" vim: et ts=4 sw=2 sts=2:
-- 
cgit 


From 30374db9554d871c217f41d00ce015b8e00b8680 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Wed, 24 Apr 2024 23:44:01 +0200
Subject: vim-patch:a4c085a3e607

runtime(java): Improve the recognition of the "style" method declarations

- Request the new regexp engine (v7.3.970) for [:upper:] and
  [:lower:].

- Recognise declarations of in-line annotated methods.

- Recognise declarations of _strictfp_ methods.

- Establish partial order for method modifiers as shown in
  the MethodModifier production; namely, _public_ and
  friends should be written the leftmost, possibly followed
  by _abstract_ or _default_, or possibly followed by other
  modifiers.

- Stop looking for parameterisable primitive types (void,
  int, etc., are malformed).

- Stop looking for arrays of _void_.

- Acknowledge the prevailing convention for method names to
  begin with a small letter and for class/interface names to
  begin with a capital letter; and, therefore, desist from
  claiming declarations of enum constants and constructors
  with javaFuncDef.
  Rationale:
    + Constructor is distinct from method:
      * its (overloaded) name is not arbitrary;
      * its return type is implicit;
      * its _throws_ clause depends on indirect vagaries of
        instance (variable) initialisers;
      * its invocation makes other constructors of its type
        hierarchy invoked one by one, concluding with the
        primordial constructor;
      * its explicit invocation, via _this_ or _super_, can
        only appear as the first statement in a constructor
        (not anymore, see JEP 447); else, its _super_ call
        cannot appear in constructors of _record_ or _enum_;
        and neither invocation is allowed for the primordial
        constructor;
      * it is not a member of its class, like initialisers,
        and is never inherited;
      * it is never _abstract_ or _native_.
    + Constructor declarations tend to be few in number and
      merit visual recognition from method declarations.
    + Enum constants define a fixed set of type instances
      and more resemble class variable initialisers.

Note that the code duplicated for @javaFuncParams is written
keeping in mind for g:java_highlight_functions a pending 3rd
variant, which would require none of the :syn-cluster added
groups.

closes: vim/vim#14620

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

Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com>
---
 runtime/syntax/java.vim | 40 +++++++++++++++++++++++-----------------
 1 file changed, 23 insertions(+), 17 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index e85174e7b0..8ffe9e0626 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
 " Maintainer:		Aliaksei Budavei <0x000c70 AT gmail DOT com>
 " Former Maintainer:	Claudio Fleiner 
 " Repository:		https://github.com/zzzyxwvut/java-vim.git
-" Last Change:		2024 Apr 13
+" Last Change:		2024 Apr 22
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -82,7 +82,8 @@ syn match   javaConceptKind	"\\%(\s*\%(:\|->\)\)\@!"
 " ".java\=" extension used for a production version and an arbitrary
 " extension used for a testing version.
 let s:module_info_cur_buf = fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!'
-lockvar s:module_info_cur_buf
+let s:selectable_regexp_engine = !(v:version < 704)
+lockvar s:selectable_regexp_engine s:module_info_cur_buf
 
 " Java modules (since Java 9, for "module-info.java" file).
 if s:module_info_cur_buf
@@ -287,24 +288,29 @@ syn match   javaSpecial "\\u\x\x\x\x"
 
 syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpecial,javaStringError,javaTextBlockError
 
+" Method declarations (JLS-17, §8.4.3, §8.4.4, §9.4).
 if exists("java_highlight_functions")
+  syn cluster javaFuncParams contains=javaAnnotation,@javaClasses,javaType,javaVarArg,javaComment,javaLineComment
+
   if java_highlight_functions == "indent"
-    syn match javaFuncDef "^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*)" contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
-    syn region javaFuncDef start=+^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*,\s*+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,@javaClasses,javaAnnotation
+    syn cluster javaFuncParams add=javaScopeDecl,javaConceptKind,javaStorageClass,javaExternal
+    syn match javaFuncDef "^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*)" contains=@javaFuncParams
+    syn region javaFuncDef start=+^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*,\s*+ end=+)+ contains=@javaFuncParams
   else
     " This is the "style" variant (:help ft-java-syntax).
-    "
-    " Match arbitrarily indented method and constructor declarations
-    " and some enum constants.
-    "
-    " TODO: Come back to refine and fix the parts of javaFuncDef.
-    " TODO: Request the new regexp engine for [:upper:] and [:lower:].
-    "
-    " XXX: \C\<[^a-z0-9]\k*\> rejects "type", but matches "τύπος".
-    " XXX: \C\<[^A-Z0-9]\k*\> rejects "Method", but matches "Μέθοδος".
-    "
-    " Match: [abstract] [<α, β>] [Τʬ][<γ>][[][]] [μΜ]ʭʭ(/* ... */);
-    syn region javaFuncDef start=+^\s\+\%(\%(public\|protected\|private\|static\|\%(abstract\|default\)\|final\|native\|synchronized\)\s\+\)*\%(<.*>\s\+\)\=\%(\%(void\|boolean\|char\|byte\|short\|int\|long\|float\|double\|\%(\K\k*\.\)*\<[^a-z0-9]\k*\>\)\%(<[^(){}]*>\)\=\%(\[\]\)*\s\+\<[^A-Z0-9]\k*\>\|\<[^a-z0-9]\k*\>\)\s*(+ end=+)+ contains=javaScopeDecl,javaConceptKind,javaType,javaStorageClass,javaComment,javaLineComment,@javaClasses,javaAnnotation
+    syn cluster javaFuncParams add=javaScopeDecl,javaConceptKind,javaStorageClass,javaExternal
+
+    " Match arbitrarily indented camelCasedName method declarations.
+    " Match: [@ɐ] [abstract] [<α, β>] Τʬ[<γ>][[][]] μʭʭ(/* ... */);
+
+    if s:selectable_regexp_engine
+      " Request the new regexp engine for [:upper:] and [:lower:].
+      syn region javaFuncDef start=/\%#=2^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@1\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<[$_[:upper:]]\k*\>\%(<[^(){}]*[[:space:]-]\@1\)\=\)\%(\[\]\)*\)\s\+\<[$_[:lower:]]\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams
+    else
+      " XXX: \C\<[^a-z0-9]\k*\> rejects "type", but matches "τύπος".
+      " XXX: \C\<[^A-Z0-9]\k*\> rejects "Method", but matches "Μέθοδος".
+      syn region javaFuncDef start=/^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@1\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<[^a-z0-9]\k*\>\%(<[^(){}]*[[:space:]-]\@1\)\=\)\%(\[\]\)*\)\s\+\<[^A-Z0-9]\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams
+    endif
   endif
 
   syn match   javaLambdaDef "\<\K\k*\>\%(\\)\@"
@@ -476,6 +482,6 @@ endif
 
 let b:spell_options = "contained"
 let &cpo = s:cpo_save
-unlet s:module_info_cur_buf s:cpo_save
+unlet s:selectable_regexp_engine s:module_info_cur_buf s:cpo_save
 
 " vim: ts=8
-- 
cgit 


From 0547347e72c1e345faf7b7d835a806bfb1f59b68 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 27 Apr 2024 10:31:09 +0200
Subject: vim-patch:79952b9c6774

runtime(jq): include syntax, ftplugin and compiler plugin

closes: vim/vim#14619

https://github.com/vim/vim/commit/79952b9c6774d30f248a0ecf9ea84318be947fc4

Co-authored-by: Vito 
---
 runtime/syntax/jq.vim   | 130 ++++++++++++++++++++++++++++++++++++++++++++++++
 runtime/syntax/json.vim |   2 +-
 2 files changed, 131 insertions(+), 1 deletion(-)
 create mode 100644 runtime/syntax/jq.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/jq.vim b/runtime/syntax/jq.vim
new file mode 100644
index 0000000000..272dcb4ebe
--- /dev/null
+++ b/runtime/syntax/jq.vim
@@ -0,0 +1,130 @@
+" Vim compiler file
+" Language:	jq
+" Maintainer:	Vito 
+" Last Change:	2024 Apr 17
+" Upstream: https://github.com/vito-c/jq.vim
+"
+" Quit when a (custom) syntax file was already loaded
+if exists('b:current_syntax')
+  finish
+endif
+
+" syn include @jqHtml syntax/html.vim  " Doc comment HTML
+
+" jqTodo
+syntax keyword jqTodo contained TODO FIXME NOTE XXX
+
+" jqKeywords
+syntax keyword jqKeywords and or not empty
+syntax keyword jqKeywords try catch
+syntax keyword jqKeywords reduce as label break foreach
+syntax keyword jqKeywords import include module modulemeta
+syntax keyword jqKeywords env nth has in while error stderr debug
+
+" jqConditional
+syntax keyword jqConditional if then elif else end
+
+" jqConditions
+syntax keyword jqCondtions true false null
+
+" jqSpecials
+syntax keyword jqType type
+syntax match jqType /[\|;]/ " not really a type I did this for coloring reasons though :help group-name
+syntax region jqParentheses start=+(+ end=+)+ fold transparent
+
+" jq Functions
+syntax keyword jqFunction add all any arrays ascii_downcase floor
+syntax keyword jqFunction ascii_upcase booleans bsearch builtins capture combinations
+syntax keyword jqFunction \contains del delpaths endswith explode
+syntax keyword jqFunction finites first flatten format from_entries
+syntax keyword jqFunction fromdate fromdateiso8601 fromjson fromstream get_jq_origin
+syntax keyword jqFunction get_prog_origin get_search_list getpath gmtime group_by
+syntax keyword jqFunction gsub halt halt_error implode index indices infinite
+syntax keyword jqFunction input input_filename input_line_number inputs inside
+syntax keyword jqFunction isempty isfinite isinfinite isnan isnormal iterables
+syntax keyword jqFunction join keys keys_unsorted last leaf_paths
+syntax keyword jqFunction length limit localtime ltrimstr map map_values
+syntax keyword jqFunction match max max_by min min_by
+syntax keyword jqFunction mktime nan normals now
+syntax keyword jqFunction nulls numbers objects path paths range
+syntax keyword jqFunction recurse recurse_down repeat reverse rindex
+syntax keyword jqFunction rtrimstr scalars scalars_or_empty scan select
+syntax keyword jqFunction setpath sort sort_by split splits with_entries
+syntax keyword jqFunction startswith strflocaltime strftime strings strptime sub
+syntax keyword jqFunction test to_entries todate todateiso8601 tojson __loc__
+syntax keyword jqFunction tonumber tostream tostring transpose truncate_stream
+syntax keyword jqFunction unique unique_by until utf8bytelength values walk
+" TODO: $__loc__ is going to be a pain
+
+" jq Math Functions
+syntax keyword jqFunction acos acosh asin asinh atan atanh cbrt ceil cos cosh
+syntax keyword jqFunction erf erfc exp exp10 exp2 expm1 fabs floor gamma j0 j1
+syntax keyword jqFunction lgamma lgamma_r log log10 log1p log2 logb nearbyint
+syntax keyword jqFunction pow10 rint round significand sin sinh sqrt tan tanh
+syntax keyword jqFunction tgamma trunc y0 y1
+syntax keyword jqFunction atan2 copysign drem fdim fmax fmin fmod frexp hypot
+syntax keyword jqFunction jn ldexp modf nextafter nexttoward pow remainder
+syntax keyword jqFunction scalb scalbln yn
+syntax keyword jqFunction fma
+
+" jq SQL-style Operators
+syntax keyword jqFunction INDEX JOIN IN
+
+" Macro
+syntax match jqMacro "@\%(text\|json\|html\|uri\|[ct]sv\|sh\|base64d\?\)\>"
+
+" Comments
+syntax match jqComment "#.*" contains=jqTodo
+
+" Variables
+syn match jqVariables /$[_A-Za-z0-9]\+/
+
+" Definition
+syntax keyword jqKeywords def nextgroup=jqNameDefinition skipwhite
+syn match jqNameDefinition /\<[_A-Za-z0-9]\+\>/ contained nextgroup=jqPostNameDefinition
+syn match jqNameDefinition /`[^`]\+`/ contained nextgroup=jqPostNameDefinition
+
+" Strings
+syn region jqError start=+'+ end=+'\|$\|[;)]\@=+
+syn region jqString matchgroup=jqQuote
+            \ start=+"+ skip=+\\[\\"]+ end=+"+
+            \ contains=@Spell,jqInterpolation
+syn region jqInterpolation matchgroup=jqInterpolationDelimiter
+            \ start=+\%([^\\]\%(\\\\\)*\\\)\@=]\|\/\/\)=\?\|[!|]=\|?\/\//
+"syn region jqRange matchgroup=jqSquareBracket start=+\[+ skip=+:+ end=+\]+
+
+" Errors
+syn keyword jqError _assign _flatten _modify _nwise _plus _negate _minus _multiply
+syn keyword jqError _divide _mod _strindices _equal _notequal _less _greater _lesseq
+syn keyword jqError _greatereq _sort_by_impl _group_by_impl _min_by_impl _max_by_impl _match_impl _input
+" TODO: these errors should show up when doing def _flatten: as well
+
+" Numbers
+syn match jqNumber /\<0[dDfFlL]\?\>/ " Just a bare 0
+syn match jqNumber /\<[1-9]\d*[dDfFlL]\?\>/  " A multi-digit number - octal numbers with leading 0's are deprecated in Scala
+
+if !exists('jq_quote_highlight')
+    highlight def link jqQuote        String
+else
+    highlight def link jqQuote        Type
+endif
+
+hi def link jqCondtions              Boolean
+hi def link jqVariables              Identifier
+hi def link jqNameDefinition         Function
+hi def link jqTodo                   Todo
+hi def link jqComment                Comment
+hi def link jqKeywords               Keyword
+hi def link jqType                   Type
+hi def link jqOperator               Operator
+hi def link jqFunction               Function
+hi def link jqMacro                  Macro
+hi def link jqError                  Error
+hi def link jqString                 String
+hi def link jqInterpolationDelimiter Delimiter
+hi def link jqConditional            Conditional
+hi def link jqNumber                 Number
diff --git a/runtime/syntax/json.vim b/runtime/syntax/json.vim
index 3f49b0c5ea..f61a17e120 100644
--- a/runtime/syntax/json.vim
+++ b/runtime/syntax/json.vim
@@ -1,6 +1,6 @@
 " Vim syntax file
 " Language:	JSON
-" Maintainer:	vacancy
+" Maintainer:	Vito 
 " Previous Maintainer:	Eli Parra 
 " Last Change:	2019 Sep 17
 " Version:      0.12
-- 
cgit 


From 499070148d8020e1da21b137a94d0aa31a5b65f4 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 27 Apr 2024 12:26:18 +0200
Subject: vim-patch:92917069b1a8

runtime(debversions): Add oracular (24.10) as Ubuntu release name

closes: vim/vim#14645

https://github.com/vim/vim/commit/92917069b1a89e0e6c253a585dfe0a19cc2c0699

Co-authored-by: Simon Quigley 
---
 runtime/syntax/shared/debversions.vim | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/shared/debversions.vim b/runtime/syntax/shared/debversions.vim
index 4aec246e27..e18eca96b1 100644
--- a/runtime/syntax/shared/debversions.vim
+++ b/runtime/syntax/shared/debversions.vim
@@ -1,7 +1,7 @@
 " Vim syntax file
 " Language:     Debian version information
 " Maintainer:   Debian Vim Maintainers
-" Last Change: 2024 Jan 25
+" Last Change:  2024 Apr 27
 " URL: https://salsa.debian.org/vim-team/vim-debian/blob/main/syntax/shared/debversions.vim
 
 let s:cpo = &cpo
@@ -11,7 +11,7 @@ let g:debSharedSupportedVersions = [
       \ 'oldstable', 'stable', 'testing', 'unstable', 'experimental', 'sid', 'rc-buggy',
       \ 'bullseye', 'bookworm', 'trixie', 'forky',
       \
-      \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'mantic', 'noble',
+      \ 'trusty', 'xenial', 'bionic', 'focal', 'jammy', 'mantic', 'noble', 'oracular',
       \ 'devel'
       \ ]
 let g:debSharedUnsupportedVersions = [
-- 
cgit 


From a26c114577b2cbd91d2fa055cf37eea10579e6a3 Mon Sep 17 00:00:00 2001
From: ObserverOfTime 
Date: Mon, 29 Apr 2024 00:50:13 +0300
Subject: vim-patch:f351fd829204 (#28551)

runtime(ssa): improve syntax file performance (vim/vim#14654)

fixes: vim/vim#14653
fixes: neovim/neovim#25950

https://github.com/vim/vim/commit/f351fd82920427b33a160cab9fdbc35ac1deb681
---
 runtime/syntax/ssa.vim | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/ssa.vim b/runtime/syntax/ssa.vim
index a5dbf37c30..3cfae816ff 100644
--- a/runtime/syntax/ssa.vim
+++ b/runtime/syntax/ssa.vim
@@ -2,7 +2,7 @@
 " Language:	SubStation Alpha
 " Maintainer:	ObserverOfTime 
 " Filenames:	*.ass,*.ssa
-" Last Change:	2022 Oct 10
+" Last Change:	2024 Apr 28
 
 if exists('b:current_syntax')
     finish
@@ -20,16 +20,20 @@ syn match ssaSection /^\[[a-zA-Z0-9+ ]\+\]$/
 syn match ssaHeader /^[^;!:]\+:/ skipwhite nextgroup=ssaField
 
 " Fields
-syn match ssaField /[^,]*/ contained skipwhite nextgroup=ssaDelimiter
+syn match ssaField /[^,]*\(,\|$\)/ contained skipwhite contains=ssaDelimiter,ssaTime nextgroup=ssaField
 
 " Time
-syn match ssaTime /\d:\d\d:\d\d\.\d\d/ contained skipwhite nextgroup=ssaDelimiter
+syn match ssaTime /\d:\d\d:\d\d\.\d\d/ contained
 
 " Delimiter
-syn match ssaDelimiter /,/ contained skipwhite nextgroup=ssaField,ssaTime,ssaText
+syn match ssaDelimiter /,/ contained
+
+" Dialogue
+syn match ssaDialogue /^Dialogue:/ transparent skipwhite nextgroup=ssaDialogueFields
+syn match ssaDialogueFields /\([^,]*,\)\{9\}/ contained transparent skipwhite contains=ssaField,ssaDelimiter nextgroup=ssaText
 
 " Text
-syn match ssaText /\(^Dialogue:\(.*,\)\{9}\)\@<=.*$/ contained contains=@ssaTags,@Spell
+syn match ssaText /.*$/ contained contains=@ssaTags,@Spell
 syn cluster ssaTags contains=ssaOverrideTag,ssaEscapeChar,ssaTextComment,ssaItalics,ssaBold,ssaUnderline,ssaStrikeout
 
 " Override tags
@@ -60,4 +64,4 @@ hi ssaItalics cterm=italic gui=italic
 hi ssaStrikeout cterm=strikethrough gui=strikethrough
 hi ssaUnderline cterm=underline gui=underline
 
-let b:current_syntax = 'srt'
+let b:current_syntax = 'ssa'
-- 
cgit 


From b7e5769132e865122fe4bf8588be9ca1820db802 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 29 Apr 2024 23:44:53 +0200
Subject: vim-patch:c4d0c8c81245

runtime(java): Improve the recognition of the "indent" method declarations (vim/vim#14659)

There is a flaw in the current implementation that has been
exacerbated around v5.2.  It lies in the recognition of all
three indentation styles simultaneously: a tab, two space,
and eight space character(s).  With it, it is not uncommon
to misidentify various constructs as method declarations
when they belong to two-space indented members and other
blocks of a type and are offset at eight space characters or
a tab from the start of the line.

For example,

------------------------------------------------------------
class Test
{
  static String hello() { return "hello"; }

  public static void main(String[] args)
  {
    try {
      if (args.length > 0) {
        // FIXME: eight spaces.
        System.out.println(args[0]);
      } else {
        // FIXME: a tab.
	System.out.println(hello());
      }
    } catch (Exception e) {
      throw new Error(e);
    }
  }
}
------------------------------------------------------------

------------------------------------------------------------
:let g:java_highlight_functions = 'indent'
:doautocmd Syntax
------------------------------------------------------------

A better approach is to pick an only indentation style out
of all supported styles (so either two spaces _or_ eight
spaces _or_ a tab).  Note that tabs and spaces can still be
mixed, only the leading tab or the leading run of spaces
matters for the recognition.  And there is no reason to not
complement the set of valid styles with any number of spaces
from 1 to 8, inclusively.

Please proceed with the necessary change as follows:

- rename from "indent" to "indent2" for a 2-space run;
- rename from "indent" to "indent8" for an 8-space run;
- continue to have "indent" for a tab run;
- define an "indent" variable with a suffix number denoting
  the preferred amount of indentation for any other run of
  spaces [1-8].

As before, this alternative style of recognition of method
declarations still does not prescribe naming conventions and
still cannot recognise method declarations in nested types
that are conventionally indented.

The proposed changes also follow suit of "style" in stopping
the claiming of constructor and enum constant declarations.

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

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
---
 runtime/syntax/java.vim | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index 8ffe9e0626..ff9b4b04be 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
 " Maintainer:		Aliaksei Budavei <0x000c70 AT gmail DOT com>
 " Former Maintainer:	Claudio Fleiner 
 " Repository:		https://github.com/zzzyxwvut/java-vim.git
-" Last Change:		2024 Apr 22
+" Last Change:		2024 Apr 28
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -292,10 +292,23 @@ syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpe
 if exists("java_highlight_functions")
   syn cluster javaFuncParams contains=javaAnnotation,@javaClasses,javaType,javaVarArg,javaComment,javaLineComment
 
-  if java_highlight_functions == "indent"
+  if java_highlight_functions =~# '^indent[1-8]\=$'
+    let s:last = java_highlight_functions[-1 :]
+    let s:indent = s:last != 't' ? repeat("\x20", s:last) : "\t"
     syn cluster javaFuncParams add=javaScopeDecl,javaConceptKind,javaStorageClass,javaExternal
-    syn match javaFuncDef "^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*)" contains=@javaFuncParams
-    syn region javaFuncDef start=+^\%(\t\|  \%( \{6\}\)\=\)\K\%(\k\|[ .,<>\[\]]\)*([^-+*/]*,\s*+ end=+)+ contains=@javaFuncParams
+    " Try to not match other type members, initialiser blocks, enum
+    " constants (JLS-17, §8.9.1), and constructors (JLS-17, §8.1.7):
+    " at any _conventional_ indentation, skip over all fields with
+    " "[^=]*", all records with "\]\+>\+\s\+\|\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)\+\)\=\%(\<\K\k*\>\.\)*\K\k*\>[^=]*\%(\\)\s\+\)*p\%(ublic\|rotected\|rivate\)\s\+\%(<[^>]\+>\+\s\+\)\=\K\k*\s*\ze(+ contains=javaAnnotation,javaScopeDecl'
+    exec 'syn match javaEnumSkipArgumentativeConstant transparent +^' . s:indent . '\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\K\k*\s*\ze(+ contains=javaAnnotation'
+    unlet s:indent s:last
   else
     " This is the "style" variant (:help ft-java-syntax).
     syn cluster javaFuncParams add=javaScopeDecl,javaConceptKind,javaStorageClass,javaExternal
-- 
cgit 


From 9e2f378b6d255cd4b02a39b1a1dc5aea2df1a84c Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Wed, 1 May 2024 18:46:10 +0200
Subject: vim-patch:9.1.0386: filetype: stylus files not recognized

Problem:  filetype: stylus files not recognized
Solution: Detect '*.styl' and '*.stylus' as stylus filetype,
          include indent, filetype and syntax plugin
          (Philip H)

closes: vim/vim#14656

https://github.com/vim/vim/commit/2d919d2744a99c9bb9e79984e85b8e8f5ec14c07

Co-authored-by: Philip H <47042125+pheiduck@users.noreply.github.com>
---
 runtime/syntax/stylus.vim | 61 +++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 runtime/syntax/stylus.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/stylus.vim b/runtime/syntax/stylus.vim
new file mode 100644
index 0000000000..fd0f33b65a
--- /dev/null
+++ b/runtime/syntax/stylus.vim
@@ -0,0 +1,61 @@
+" Vim syntax file
+" Language:	Stylus
+" Maintainer:	Hsiaoming Yang , Marc Harter
+" Filenames: *.styl, *.stylus
+" Based On: Tim Pope (sass.vim)
+" Created:	Dec 14, 2011
+" Modified:	Apr 29, 2024
+
+if main_syntax == "css"
+  syn sync minlines=10
+endif
+
+" let b:current_syntax = "css"
+"
+if main_syntax == 'css'
+  unlet main_syntax
+endif
+
+syn case ignore
+
+syn cluster stylusCssSelectors contains=cssTagName,cssSelector,cssPseudo
+syn cluster stylusCssValues contains=cssValueLength,cssValueInteger,cssValueNumber,cssValueAngle,cssValueTime,cssValueFrequency,cssColorVal,cssCommonVal,cssFontVal,cssListVal,cssTextVal,cssVisualVal,cssBorderVal,cssBackgroundVal,cssFuncVal,cssAdvancedVal
+syn cluster stylusCssProperties contains=cssProp,cssBackgroundProp,cssTableProp,cssBorderProp,cssFontProp,cssColorProp,cssBoxProp,cssTextProp,cssListProp,cssVisualProp,cssAdvancedProp,cssCommonProp,cssSpecialProp
+
+syn match stylusVariable "$\?[[:alnum:]_-]\+"
+syn match stylusVariableAssignment "\%([[:alnum:]_-]\+\s*\)\@<==" nextgroup=stylusCssAttribute,stylusVariable skipwhite
+
+syn match stylusProperty "\%([{};]\s*\|^\)\@<=\%([[:alnum:]-]\|#{[^{}]*}\)\+:" contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute contained containedin=cssDefineBlock
+syn match stylusProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+[ :]\|:[[:alnum:]-]\+\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute
+syn match stylusProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute
+
+syn match stylusCssAttribute +\%("\%([^"]\|\\"\)*"\|'\%([^']\|\\'\)*'\|#{[^{}]*}\|[^{};]\)*+ contained contains=@stylusCssValues,cssImportant,stylusFunction,stylusVariable,stylusControl,stylusUserFunction,stylusInterpolation,cssString,stylusComment,cssComment
+
+syn match stylusInterpolation %{[[:alnum:]_-]\+}%
+
+syn match stylusFunction "\<\%(red\|green\|blue\|alpha\|dark\|light\)\>(\@=" contained
+syn match stylusFunction "\<\%(hue\|saturation\|lightness\|push\|unshift\|typeof\|unit\|match\)\>(\@=" contained
+syn match stylusFunction "\<\%(hsla\|hsl\|rgba\|rgb\|lighten\|darken\)\>(\@=" contained
+syn match stylusFunction "\<\%(abs\|ceil\|floor\|round\|min\|max\|even\|odd\|sum\|avg\|sin\|cos\|join\)\>(\@=" contained
+syn match stylusFunction "\<\%(desaturate\|saturate\|invert\|unquote\|quote\|s\)\>(\@=" contained
+syn match stylusFunction "\<\%(operate\|length\|warn\|error\|last\|p\|\)\>(\@=" contained
+syn match stylusFunction "\<\%(opposite-position\|image-size\|add-property\)\>(\@=" contained
+
+syn keyword stylusVariable null true false arguments
+syn keyword stylusControl  if else unless for in return
+
+syn match stylusImport "@\%(import\|require\)" nextgroup=stylusImportList
+syn match stylusImportList "[^;]\+" contained contains=cssString.*,cssMediaType,cssURL
+
+syn match stylusAmpersand  "&"
+syn match stylusClass      "[[:alnum:]_-]\+" contained
+syn match stylusClassChar  "\.[[:alnum:]_-]\@=" nextgroup=stylusClass
+syn match stylusEscape     "^\s*\zs\\"
+syn match stylusId         "[[:alnum:]_-]\+" contained
+syn match stylusIdChar     "#[[:alnum:]_-]\@=" nextgroup=stylusId
+
+syn region stylusComment    start="//" end="$" contains=cssTodo,@Spell fold
+
+let b:current_syntax = "stylus"
+
+" vim:set sw=2:
-- 
cgit 


From 17c89eac1a384aaf9956ed75e60295aba8c78d01 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Tue, 7 May 2024 19:14:55 +0200
Subject: vim-patch:c5def6561d56

runtime(cpp): Fix digit separator in syntax script for octals and floats

Also fix the incorrect rendering of floats that start with ".".

closes: vim/vim#14724

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

Co-authored-by: Wu Yongwei 
---
 runtime/syntax/cpp.vim | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/cpp.vim b/runtime/syntax/cpp.vim
index 8daf90a33c..ff1226b7b0 100644
--- a/runtime/syntax/cpp.vim
+++ b/runtime/syntax/cpp.vim
@@ -2,7 +2,8 @@
 " Language:	C++
 " Current Maintainer:	vim-jp (https://github.com/vim-jp/vim-cpp)
 " Previous Maintainer:	Ken Shan 
-" Last Change:	2023 Dec 08
+" Last Change:	2024 May 04
+"   2024 May 04 by Vim Project (fix digit separator in octals and floats)
 
 " quit when a syntax file was already loaded
 if exists("b:current_syntax")
@@ -55,11 +56,11 @@ if !exists("cpp_no_cpp14")
   syn match cppNumbers		display transparent "\<\d\|\.\d" contains=cppNumber,cppFloat
   syn match cppNumber		display contained "\<0\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppNumber		display contained "\<[1-9]\('\=\d\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
-  syn match cppNumber		display contained "\<0\o\+\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
+  syn match cppNumber		display contained "\<0\('\=\o\+\)\+\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppNumber		display contained "\<0b[01]\('\=[01]\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppNumber		display contained "\<0x\x\('\=\x\+\)*\([Uu]\=\([Ll]\|LL\|ll\)\|\([Ll]\|LL\|ll\)\=[Uu]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
-  syn match cppFloat		display contained "\<\d\+\.\d*\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
-  syn match cppFloat		display contained "\<\.\d\+\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
+  syn match cppFloat		display contained "\<\d\('\=\d\+\)*\.\(\d\('\=\d\+\)*\)\=\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
+  syn match cppFloat		display contained "\.\d\('\=\d\+\)*\(e[-+]\=\d\+\)\=\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn match cppFloat		display contained "\<\d\+e[-+]\=\d\+\([FfLl]\|i[fl]\=\|h\|min\|s\|ms\|us\|ns\|_\i*\)\=\>"
   syn region cppString		start=+\(L\|u\|u8\|U\)\="+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"\(sv\|s\|_\i*\)\=+ end='$' contains=cSpecial,cFormat,@Spell
 endif
-- 
cgit 


From d3fa88b70f6f96ec4bc505968afec1dedb3b450b Mon Sep 17 00:00:00 2001
From: Gregory Anders <8965202+gpanders@users.noreply.github.com>
Date: Wed, 8 May 2024 18:39:18 -0500
Subject: vim-patch:9.1.0396: filetype: jj files are not recognized (#28672)

Problem:  jj files are not recognized
Solution: recognize '*.jjdescription' files as jj filetype
          (Gregory Anders)

See: https://github.com/martinvonz/jj

closes: vim/vim#14733

https://github.com/vim/vim/commit/6a4ea471d28107c4078e106ace1bdc0c54bf946b
---
 runtime/syntax/jj.vim | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
 create mode 100644 runtime/syntax/jj.vim

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/jj.vim b/runtime/syntax/jj.vim
new file mode 100644
index 0000000000..a2911a0268
--- /dev/null
+++ b/runtime/syntax/jj.vim
@@ -0,0 +1,20 @@
+" Vim syntax file
+" Language:	jj description
+" Maintainer:	Gregory Anders 
+" Last Change:	2024 May 8
+
+if exists('b:current_syntax')
+  finish
+endif
+let b:current_syntax = 'jj'
+
+syn match jjAdded "A .*" contained
+syn match jjRemoved "D .*" contained
+syn match jjChanged "M .*" contained
+
+syn region jjComment start="^JJ: " end="$" contains=jjAdded,jjRemoved,jjChanged
+
+hi def link jjComment Comment
+hi def link jjAdded Added
+hi def link jjRemoved Removed
+hi def link jjChanged Changed
-- 
cgit 


From ca735c7554701a1191e6afdac2ea4b4f94ba6d88 Mon Sep 17 00:00:00 2001
From: zeertzjq 
Date: Fri, 10 May 2024 06:12:09 +0800
Subject: vim-patch:cb3691811be9 (#28684)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

runtime(spec): add new items to scripts section in syntax plugin

- %generate_buildrequires — added in RPM 4.15
- %conf — added in RPM 4.18

closes: vim/vim#14723

Ref: https://rpm-software-management.github.io/rpm/manual/spec.html#build-scriptlets

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

Co-authored-by: Maxwell G 
---
 runtime/syntax/spec.vim | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/spec.vim b/runtime/syntax/spec.vim
index 12ce8d5ac1..4cb3a343eb 100644
--- a/runtime/syntax/spec.vim
+++ b/runtime/syntax/spec.vim
@@ -111,7 +111,7 @@ syn region specDescriptionArea matchgroup=specSection start='^%description' end=
 syn region specPackageArea matchgroup=specSection start='^%package' end='^%'me=e-1 contains=specPackageOpts,specPreAmble,specComment
 
 "%% Scripts Section %%
-syn region specScriptArea matchgroup=specSection start='^%\(prep\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2
+syn region specScriptArea matchgroup=specSection start='^%\(prep\|generate_buildrequires\|conf\|build\|install\|clean\|check\|pre\|postun\|preun\|post\|posttrans\)\>' skip='^%{\|^%\(define\|patch\d*\|configure\|GNUconfigure\|setup\|autosetup\|autopatch\|find_lang\|make_build\|makeinstall\|make_install\)\>' end='^%'me=e-1 contains=specSpecialVariables,specVariables,@specCommands,specVariables,shDo,shFor,shCaseEsac,specNoNumberHilite,specCommandOpts,shComment,shIf,specSpecialChar,specMacroIdentifier,specSectionMacroArea,specSectionMacroBracketArea,shOperator,shQuote1,shQuote2
 
 "%% Changelog Section %%
 syn region specChangelogArea matchgroup=specSection start='^%changelog' end='^%'me=e-1 contains=specEmail,specURL,specWeekday,specMonth,specNumber,specComment,specLicense
-- 
cgit 


From 17d8f3b32ac18fcabf8e9869b8d9b88df27d1934 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Fri, 10 May 2024 17:05:25 +0200
Subject: vim-patch:06bdac158072
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

runtime(java): Stop handpicking syntax groups for @javaTop (vim/vim#14727)

* runtime(java): Stop handpicking syntax groups for @javaTop

Also:

- Remove the obsolete comment for g:java_allow_cpp_keywords.
- Remove the commented out groups java\%[Debug\]StringError.
- Infer and set the preferred formatting Vim options from
  the modeline.

Since vim-6-0u, non-contained syntax groups can be referred
to by using the "contains=TOP..." argument.

* Set &encoding and &termencoding to "utf-8" for test files

* Limit non-ASCII charset to [§ƒɐɘʬʭΑ-Τα-μ] for test files

https://github.com/vim/vim/commit/06bdac158072b90560915f8e664ee6d9bdab2f9b

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
---
 runtime/syntax/java.vim | 39 ++++++++-------------------------------
 1 file changed, 8 insertions(+), 31 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index ff9b4b04be..4bf154473d 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
 " Maintainer:		Aliaksei Budavei <0x000c70 AT gmail DOT com>
 " Former Maintainer:	Claudio Fleiner 
 " Repository:		https://github.com/zzzyxwvut/java-vim.git
-" Last Change:		2024 Apr 28
+" Last Change:		2024 May 07
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -90,7 +90,6 @@ if s:module_info_cur_buf
   syn keyword javaModuleStorageClass	module transitive
   syn keyword javaModuleStmt		open requires exports opens uses provides
   syn keyword javaModuleExternal	to with
-  syn cluster javaTop add=javaModuleStorageClass,javaModuleStmt,javaModuleExternal
 endif
 
 if exists("java_highlight_java_lang_ids")
@@ -107,7 +106,6 @@ if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("ja
   " the current keyword placement. The below _match_es follow suit.
 
   syn keyword javaR_JavaLang ArithmeticException ArrayIndexOutOfBoundsException ArrayStoreException ClassCastException IllegalArgumentException IllegalMonitorStateException IllegalThreadStateException IndexOutOfBoundsException NegativeArraySizeException NullPointerException NumberFormatException RuntimeException SecurityException StringIndexOutOfBoundsException IllegalStateException UnsupportedOperationException EnumConstantNotPresentException TypeNotPresentException IllegalCallerException LayerInstantiationException WrongThreadException MatchException
-  syn cluster javaTop add=javaR_JavaLang
   syn cluster javaClasses add=javaR_JavaLang
   hi def link javaR_JavaLang javaR_Java
   " Member enumerations:
@@ -128,15 +126,12 @@ if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("ja
   syn match   javaC_JavaLang "\"	" See javaDebug.
   " As of JDK 21, java.lang.Compiler is no more (deprecated in JDK 9).
   syn keyword javaLangDeprecated Compiler
-  syn cluster javaTop add=javaC_JavaLang
   syn cluster javaClasses add=javaC_JavaLang
   hi def link javaC_JavaLang javaC_Java
   syn keyword javaE_JavaLang AbstractMethodError ClassCircularityError ClassFormatError Error IllegalAccessError IncompatibleClassChangeError InstantiationError InternalError LinkageError NoClassDefFoundError NoSuchFieldError NoSuchMethodError OutOfMemoryError StackOverflowError ThreadDeath UnknownError UnsatisfiedLinkError VerifyError VirtualMachineError ExceptionInInitializerError UnsupportedClassVersionError AssertionError BootstrapMethodError
-  syn cluster javaTop add=javaE_JavaLang
   syn cluster javaClasses add=javaE_JavaLang
   hi def link javaE_JavaLang javaE_Java
   syn keyword javaX_JavaLang ClassNotFoundException CloneNotSupportedException Exception IllegalAccessException InstantiationException InterruptedException NoSuchMethodException Throwable NoSuchFieldException ReflectiveOperationException
-  syn cluster javaTop add=javaX_JavaLang
   syn cluster javaClasses add=javaX_JavaLang
   hi def link javaX_JavaLang javaX_Java
 
@@ -152,7 +147,6 @@ if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("ja
   syn keyword javaLangObject clone equals finalize getClass hashCode
   syn keyword javaLangObject notify notifyAll toString wait
   hi def link javaLangObject		     javaConstant
-  syn cluster javaTop add=javaLangObject
 endif
 
 if filereadable(expand(":p:h")."/javaid.vim")
@@ -187,13 +181,6 @@ hi def link javaLabelVarType	javaOperator
 hi def link javaLabelNumber	javaNumber
 hi def link javaLabelCastType	javaType
 
-" highlighting C++ keywords as errors removed, too many people find it
-" annoying.  Was: if !exists("java_allow_cpp_keywords")
-
-" The following cluster contains all java groups except the contained ones
-syn cluster javaTop add=javaExternal,javaError,javaBranch,javaLabelRegion,javaConditional,javaRepeat,javaBoolean,javaConstant,javaTypedef,javaOperator,javaType,javaStatement,javaStorageClass,javaAssert,javaExceptions,javaMethodDecl,javaClassDecl,javaScopeDecl,javaConceptKind,javaError2,javaUserLabel,javaLangObject,javaAnnotation,javaVarArg
-
-
 " Comments
 syn keyword javaTodo		 contained TODO FIXME XXX
 
@@ -223,8 +210,6 @@ syn match   javaCommentError contained "/\*"me=e-1 display
 hi def link javaCommentError javaError
 hi def link javaCommentStart javaComment
 
-syn cluster javaTop add=javaComment,javaLineComment
-
 if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
   syntax case ignore
   " syntax coloring for javadoc comments (HTML)
@@ -266,8 +251,6 @@ syn match   javaTextBlockError	+"""\s*"""+
 syn region  javaStrTemplEmbExp	 contained matchgroup=javaStrTempl start="\\{" end="}" contains=TOP
 syn region  javaStrTempl	 start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,@Spell
 syn region  javaStrTempl	 start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell
-" The next line is commented out, it can cause a crash for a long line
-"syn match   javaStringError	  +"\%([^"\\]\|\\.\)*$+
 syn match   javaCharacter	 "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
 syn match   javaCharacter	 "'\\''" contains=javaSpecialChar
 syn match   javaCharacter	 "'[^\\]'"
@@ -286,8 +269,6 @@ syn match   javaNumber		 "\<0[xX]\%(\x\%(_*\x\)*\.\=\|\%(\x\%(_*\x\)*\)\=\.\x\%(
 " Unicode characters
 syn match   javaSpecial "\\u\x\x\x\x"
 
-syn cluster javaTop add=javaString,javaStrTempl,javaCharacter,javaNumber,javaSpecial,javaStringError,javaTextBlockError
-
 " Method declarations (JLS-17, §8.4.3, §8.4.4, §9.4).
 if exists("java_highlight_functions")
   syn cluster javaFuncParams contains=javaAnnotation,@javaClasses,javaType,javaVarArg,javaComment,javaLineComment
@@ -328,7 +309,6 @@ if exists("java_highlight_functions")
 
   syn match   javaLambdaDef "\<\K\k*\>\%(\\)\@"
   syn match  javaBraces  "[{}]"
-  syn cluster javaTop add=javaFuncDef,javaBraces,javaLambdaDef
 endif
 
 if exists("java_highlight_debug")
@@ -341,8 +321,6 @@ if exists("java_highlight_debug")
   syn region  javaDebugStrTemplEmbExp	contained matchgroup=javaDebugStrTempl start="\\{" end="}" contains=javaComment,javaLineComment,javaDebug\%(Paren\)\@!.*
   syn region  javaDebugStrTempl		contained start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaDebugStrTemplEmbExp,javaDebugSpecial
   syn region  javaDebugStrTempl		contained start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugStrTemplEmbExp,javaDebugSpecial,javaDebugTextBlockError
-  " The next line is commented out, it can cause a crash for a long line
-" syn match   javaDebugStringError	contained +"\%([^"\\]\|\\.\)*$+
   syn match   javaDebugTextBlockError	contained +"""\s*"""+
   syn match   javaDebugCharacter	contained "'[^\\]'"
   syn match   javaDebugSpecialCharacter contained "'\\.'"
@@ -366,13 +344,10 @@ if exists("java_highlight_debug")
 " FIXME: What API do "trace*" belong to?
 " syn match javaDebug "\?\[\]@,.]\)*)\s*->"
 endif
 
+" The @javaTop cluster comprises non-contained Java syntax groups.
+" Note that the syntax file "aidl.vim" relies on its availability.
+syn cluster javaTop contains=TOP,javaDocComment,javaFold,javaParenError,javaParenT
+
 if !exists("java_minlines")
   let java_minlines = 10
 endif
@@ -452,8 +430,7 @@ hi def link javaCharacter		Character
 hi def link javaSpecialChar		SpecialChar
 hi def link javaNumber			Number
 hi def link javaError			Error
-hi def link javaStringError		Error
-hi def link javaTextBlockError		javaStringError
+hi def link javaTextBlockError		Error
 hi def link javaStatement		Statement
 hi def link javaOperator		Operator
 hi def link javaComment		Comment
@@ -497,4 +474,4 @@ let b:spell_options = "contained"
 let &cpo = s:cpo_save
 unlet s:selectable_regexp_engine s:module_info_cur_buf s:cpo_save
 
-" vim: ts=8
+" vim: sw=2 ts=8 noet sta
-- 
cgit 


From 7f500289ebbf820cf944964a15d2a3d8147ceb77 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Sat, 11 May 2024 09:30:56 +0200
Subject: vim-patch:d3952e8cfe7b

runtime(java): Strive to remain compatible for at least Vim 7.0 (vim/vim#14744)

Also:

- Limit all look-behind regexp patterns.
- Cache regexp capabilities for [:upper:] and [:lower:].

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

Co-authored-by: Aliaksei Budavei <32549825+zzzyxwvut@users.noreply.github.com>
---
 runtime/syntax/java.vim | 131 +++++++++++++++++++++++++++++++-----------------
 1 file changed, 86 insertions(+), 45 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim
index 4bf154473d..9867b147c2 100644
--- a/runtime/syntax/java.vim
+++ b/runtime/syntax/java.vim
@@ -3,7 +3,7 @@
 " Maintainer:		Aliaksei Budavei <0x000c70 AT gmail DOT com>
 " Former Maintainer:	Claudio Fleiner 
 " Repository:		https://github.com/zzzyxwvut/java-vim.git
-" Last Change:		2024 May 07
+" Last Change:		2024 May 10
 
 " Please check :help java.vim for comments on some of the options available.
 
@@ -20,8 +20,33 @@ endif
 let s:cpo_save = &cpo
 set cpo&vim
 
+"""" STRIVE TO REMAIN COMPATIBLE FOR AT LEAST VIM 7.0.
+let s:ff = {}
+
+function! s:ff.LeftConstant(x, y) abort
+  return a:x
+endfunction
+
+function! s:ff.RightConstant(x, y) abort
+  return a:y
+endfunction
+
+if !exists("*s:ReportOnce")
+  function s:ReportOnce(message) abort
+    echomsg 'syntax/java.vim: ' . a:message
+  endfunction
+else
+  function! s:ReportOnce(dummy)
+  endfunction
+endif
+
 " Admit the ASCII dollar sign to keyword characters (JLS-17, §3.8):
-execute printf('syntax iskeyword %s,$', &l:iskeyword)
+try
+  exec 'syntax iskeyword ' . &l:iskeyword . ',$'
+catch /\\%(\s*(\)\@!"
+
 " Since the yield statement, which could take a parenthesised operand,
 " and _qualified_ yield methods get along within the switch block
 " (JLS-17, §3.8), it seems futile to make a region definition for this
@@ -49,7 +75,15 @@ syn match   javaOperator	"\\%(\s*(\)\@!"
 " backtrack (arbitrarily) 80 bytes, at most, on the matched line and,
 " if necessary, on the line before that (h: \@<=), trying to match
 " neither a method reference nor a qualified method invocation.
-syn match   javaOperator	"\%(\%(::\|\.\)[[:space:]\n]*\)\@80"
+try
+  syn match   javaOperator	"\%(\%(::\|\.\)[[:space:]\n]*\)\@80"
+  let s:ff.Peek = s:ff.LeftConstant
+catch /\"
+  let s:ff.Peek = s:ff.RightConstant
+endtry
+
 syn keyword javaType		boolean char byte short int long float double
 syn keyword javaType		void
 syn keyword javaStatement	return
@@ -82,8 +116,16 @@ syn match   javaConceptKind	"\\%(\s*\%(:\|->\)\)\@!"
 " ".java\=" extension used for a production version and an arbitrary
 " extension used for a testing version.
 let s:module_info_cur_buf = fnamemodify(bufname("%"), ":t") =~ '^module-info\%(\.class\>\)\@!'
-let s:selectable_regexp_engine = !(v:version < 704)
-lockvar s:selectable_regexp_engine s:module_info_cur_buf
+lockvar s:module_info_cur_buf
+
+if !(v:version < 704)
+  " Request the new regexp engine for [:upper:] and [:lower:].
+  let [s:ff.Engine, s:ff.UpperCase, s:ff.LowerCase] = repeat([s:ff.LeftConstant], 3)
+else
+  " XXX: \C\<[^a-z0-9]\k*\> rejects "type", but matches "τύπος".
+  " XXX: \C\<[^A-Z0-9]\k*\> rejects "Method", but matches "Μέθοδος".
+  let [s:ff.Engine, s:ff.UpperCase, s:ff.LowerCase] = repeat([s:ff.RightConstant], 3)
+endif
 
 " Java modules (since Java 9, for "module-info.java" file).
 if s:module_info_cur_buf
@@ -109,19 +151,19 @@ if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("ja
   syn cluster javaClasses add=javaR_JavaLang
   hi def link javaR_JavaLang javaR_Java
   " Member enumerations:
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
   " Member classes:
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
-  syn match   javaC_JavaLang "\%(\"
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
+  exec 'syn match javaC_JavaLang "\%(\"'
   syn keyword javaC_JavaLang Boolean Character Class ClassLoader Compiler Double Float Integer Long Math Number Object Process Runtime SecurityManager String StringBuffer Thread ThreadGroup Byte Short Void InheritableThreadLocal Package RuntimePermission ThreadLocal StrictMath StackTraceElement Enum ProcessBuilder StringBuilder ClassValue Module ModuleLayer StackWalker Record
   syn match   javaC_JavaLang "\"	" See javaDebug.
   " As of JDK 21, java.lang.Compiler is no more (deprecated in JDK 9).
@@ -149,7 +191,7 @@ if exists("java_highlight_all")  || exists("java_highlight_java")  || exists("ja
   hi def link javaLangObject		     javaConstant
 endif
 
-if filereadable(expand(":p:h")."/javaid.vim")
+if filereadable(expand(":p:h") . "/javaid.vim")
   source :p:h/javaid.vim
 endif
 
@@ -162,7 +204,7 @@ if exists("java_space_errors")
   endif
 endif
 
-syn match   javaUserLabel	"^\s*\<\K\k*\>\%(\\)\@\%(\\)\@' . s:ff.Peek('7', '') . '" matchgroup=NONE end=":\|->" contains=javaLabelCastType,javaLabelNumber,javaCharacter,javaString,javaConstant,@javaClasses,javaLabelDefault,javaLabelVarType,javaLabelWhenClause
 syn region  javaLabelRegion	transparent matchgroup=javaLabel start="\\%(\s*\%(:\|->\)\)\@=" matchgroup=NONE end=":\|->" oneline
 " Consider grouped _default_ _case_ labels, i.e.
@@ -201,7 +243,7 @@ syn match   javaCommentStar	 contained "^\s*\*$"
 syn match   javaLineComment	"//.*" contains=@javaCommentSpecial2,javaTodo,javaCommentMarkupTag,javaSpaceError,@Spell
 syn match   javaCommentMarkupTag contained "@\%(end\|highlight\|link\|replace\|start\)\>" nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite
 syn match   javaCommentMarkupTagAttr contained "\" nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite
-syn region  javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite oneline
+exec 'syn region javaCommentMarkupTagAttr contained transparent matchgroup=htmlArg start=/\<\%(re\%(gex\|gion\|placement\)\|substring\|t\%(arget\|ype\)\)\%(\s*=\)\@=/ matchgroup=htmlString end=/\%(=\s*\)\@' . s:ff.Peek('80', '') . '<=\%("[^"]\+"\|' . "\x27[^\x27]\\+\x27" . '\|\%([.-]\|\k\)\+\)/ nextgroup=javaCommentMarkupTagAttr,javaSpaceError skipwhite oneline'
 hi def link javaCommentMarkupTagAttr htmlArg
 hi def link javaCommentString javaString
 hi def link javaComment2String javaString
@@ -212,16 +254,22 @@ hi def link javaCommentStart javaComment
 
 if !exists("java_ignore_javadoc") && main_syntax != 'jsp'
   syntax case ignore
-  " syntax coloring for javadoc comments (HTML)
+
+  " Include HTML syntax coloring for Javadoc comments.
   syntax include @javaHtml syntax/html.vim
   unlet b:current_syntax
-  " HTML enables spell checking for all text that is not in a syntax item. This
-  " is wrong for Java (all identifiers would be spell-checked), so it's undone
-  " here.
-  syntax spell default
+
+  " HTML enables spell checking for all text that is not in a syntax
+  " item (:syntax spell toplevel); instead, limit spell checking to
+  " items matchable with syntax groups containing the @Spell cluster.
+  try
+    syntax spell default
+  catch /\\|\%(\k\|\.\)*\%(#\k\+\%((\_[^)]*)\)\=\)\=@ contains=@javaHtml extend
   syn region javaCodeSkipBlock	contained transparent start="{\%(@code\>\)\@!" end="}" contains=javaCodeSkipBlock,javaDocCodeTag
   syn region javaDocCodeTag	contained start="{@code\>" end="}" contains=javaDocCodeTag,javaCodeSkipBlock
-  syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@<=\%("[^"]\+"\|'[^']\+'\|\%([.\\/-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl
+  exec 'syn region javaDocSnippetTagAttr contained transparent matchgroup=htmlArg start=/\<\%(class\|file\|id\|lang\|region\)\%(\s*=\)\@=/ matchgroup=htmlString end=/:$/ end=/\%(=\s*\)\@' . s:ff.Peek('80', '') . '<=\%("[^"]\+"\|' . "\x27[^\x27]\\+\x27" . '\|\%([.\\/-]\|\k\)\+\)/ nextgroup=javaDocSnippetTagAttr skipwhite skipnl'
   syn region javaSnippetSkipBlock contained transparent start="{\%(@snippet\>\)\@!" end="}" contains=javaSnippetSkipBlock,javaDocSnippetTag,javaCommentMarkupTag
   syn region javaDocSnippetTag	contained start="{@snippet\>" end="}" contains=javaDocSnippetTag,javaSnippetSkipBlock,javaDocSnippetTagAttr,javaCommentMarkupTag
+
   syntax case match
 endif
 
@@ -249,8 +298,8 @@ syn region  javaString		start=+"+ end=+"+ end=+$+ contains=javaSpecialChar,javaS
 syn region  javaString		start=+"""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell
 syn match   javaTextBlockError	+"""\s*"""+
 syn region  javaStrTemplEmbExp	 contained matchgroup=javaStrTempl start="\\{" end="}" contains=TOP
-syn region  javaStrTempl	 start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,@Spell
-syn region  javaStrTempl	 start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell
+exec 'syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@' . s:ff.Peek('80', '') . '<="+ end=+"+ contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,@Spell'
+exec 'syn region javaStrTempl start=+\%(\.[[:space:]\n]*\)\@' . s:ff.Peek('80', '') . '<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaStrTemplEmbExp,javaSpecialChar,javaSpecialError,javaTextBlockError,@Spell'
 syn match   javaCharacter	 "'[^']*'" contains=javaSpecialChar,javaSpecialCharError
 syn match   javaCharacter	 "'\\''" contains=javaSpecialChar
 syn match   javaCharacter	 "'[^\\]'"
@@ -283,7 +332,7 @@ if exists("java_highlight_functions")
     " "[^=]*", all records with "\]\+>\+\s\+\|\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)\+\)\=\%(\<\K\k*\>\.\)*\K\k*\>[^=]*\%(\]\+>\+\s\+\|\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)\+\)\=\%(\<\K\k*\>\.\)*\K\k*\>[^=]*\%(\] Τʬ[<γ>][[][]] μʭʭ(/* ... */);
-
-    if s:selectable_regexp_engine
-      " Request the new regexp engine for [:upper:] and [:lower:].
-      syn region javaFuncDef start=/\%#=2^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@1\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<[$_[:upper:]]\k*\>\%(<[^(){}]*[[:space:]-]\@1\)\=\)\%(\[\]\)*\)\s\+\<[$_[:lower:]]\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams
-    else
-      " XXX: \C\<[^a-z0-9]\k*\> rejects "type", but matches "τύπος".
-      " XXX: \C\<[^A-Z0-9]\k*\> rejects "Method", but matches "Μέθοδος".
-      syn region javaFuncDef start=/^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@1\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<[^a-z0-9]\k*\>\%(<[^(){}]*[[:space:]-]\@1\)\=\)\%(\[\]\)*\)\s\+\<[^A-Z0-9]\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams
-    endif
+    exec 'syn region javaFuncDef start=/' . s:ff.Engine('\%#=2', '') . '^\s\+\%(\%(@\%(\K\k*\.\)*\K\k*\>\)\s\+\)*\%(p\%(ublic\|rotected\|rivate\)\s\+\)\=\%(\%(abstract\|default\)\s\+\|\%(\%(final\|\%(native\|strictfp\)\|s\%(tatic\|ynchronized\)\)\s\+\)*\)\=\%(<.*[[:space:]-]\@' . s:ff.Peek('1', '') . '\s\+\)\=\%(void\|\%(b\%(oolean\|yte\)\|char\|short\|int\|long\|float\|double\|\%(\<\K\k*\>\.\)*\<' . s:ff.UpperCase('[$_[:upper:]]', '[^a-z0-9]') . '\k*\>\%(<[^(){}]*[[:space:]-]\@' . s:ff.Peek('1', '') . '\)\=\)\%(\[\]\)*\)\s\+\<' . s:ff.LowerCase('[$_[:lower:]]', '[^A-Z0-9]') . '\k*\>\s*(/ end=/)/ skip=/\/\*.\{-}\*\/\|\/\/.*$/ contains=@javaFuncParams'
   endif
 
-  syn match   javaLambdaDef "\<\K\k*\>\%(\\)\@"
-  syn match  javaBraces  "[{}]"
+  exec 'syn match javaLambdaDef "\<\K\k*\>\%(\\)\@' . s:ff.Peek('7', '') . '"'
+  syn match javaBraces "[{}]"
 endif
 
 if exists("java_highlight_debug")
@@ -319,8 +360,8 @@ if exists("java_highlight_debug")
   " The highlight groups of java{StrTempl,Debug{,Paren,StrTempl}}\,
   " share one colour by default. Do not conflate unrelated parens.
   syn region  javaDebugStrTemplEmbExp	contained matchgroup=javaDebugStrTempl start="\\{" end="}" contains=javaComment,javaLineComment,javaDebug\%(Paren\)\@!.*
-  syn region  javaDebugStrTempl		contained start=+\%(\.[[:space:]\n]*\)\@<="+ end=+"+ contains=javaDebugStrTemplEmbExp,javaDebugSpecial
-  syn region  javaDebugStrTempl		contained start=+\%(\.[[:space:]\n]*\)\@<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugStrTemplEmbExp,javaDebugSpecial,javaDebugTextBlockError
+  exec 'syn region javaDebugStrTempl contained start=+\%(\.[[:space:]\n]*\)\@' . s:ff.Peek('80', '') . '<="+ end=+"+ contains=javaDebugStrTemplEmbExp,javaDebugSpecial'
+  exec 'syn region javaDebugStrTempl contained start=+\%(\.[[:space:]\n]*\)\@' . s:ff.Peek('80', '') . '<="""[ \t\x0c\r]*$+hs=e+1 end=+"""+he=s-1 contains=javaDebugStrTemplEmbExp,javaDebugSpecial,javaDebugTextBlockError'
   syn match   javaDebugTextBlockError	contained +"""\s*"""+
   syn match   javaDebugCharacter	contained "'[^\\]'"
   syn match   javaDebugSpecialCharacter contained "'\\.'"
@@ -382,7 +423,7 @@ hi def link javaParenError	javaError
 
 if exists("java_highlight_functions")
   " Make ()-matching definitions after the parenthesis error catcher.
-  syn match javaLambdaDef "\k\@4?\[\]@,.]\)*)\s*->"
+  exec 'syn match javaLambdaDef "\k\@' . s:ff.Peek('4', '') . '?\[\]@,.]\)*)\s*->"'
 endif
 
 " The @javaTop cluster comprises non-contained Java syntax groups.
@@ -472,6 +513,6 @@ endif
 
 let b:spell_options = "contained"
 let &cpo = s:cpo_save
-unlet s:selectable_regexp_engine s:module_info_cur_buf s:cpo_save
+unlet s:module_info_cur_buf s:ff s:cpo_save
 
 " vim: sw=2 ts=8 noet sta
-- 
cgit 


From 025e2e07d99335e6d906fd2789c404df0408edb1 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Mon, 13 May 2024 22:47:08 +0200
Subject: vim-patch:679f5abb9930
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

runtime(i3config/swayconfig): allow indented commands (vim/vim#14757)

fixes: vim/vim#14752

https://github.com/vim/vim/commit/679f5abb9930fafda29ae038f47de357e9a0f53e

Co-authored-by: Josef Litoš <54900518+JosefLitos@users.noreply.github.com>
Co-authored-by: jamespeapen 
---
 runtime/syntax/i3config.vim   | 16 ++++++++--------
 runtime/syntax/swayconfig.vim | 22 ++++++++++++----------
 2 files changed, 20 insertions(+), 18 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim
index 7441f9082a..7d01693c79 100644
--- a/runtime/syntax/i3config.vim
+++ b/runtime/syntax/i3config.vim
@@ -2,7 +2,7 @@
 " Language: i3 config file
 " Original Author: Josef Litos (JosefLitos/i3config.vim)
 " Maintainer: Quentin Hibon (github user hiqua)
-" Version: 1.2.1
+" Version: 1.2.2
 " Last Change: 2024-04-14
 
 " References:
@@ -46,7 +46,7 @@ syn match i3ConfigIncludeCommand /`[^`]*`/ contained contains=@i3ConfigSh
 syn region i3ConfigParamLine matchgroup=i3ConfigKeyword start=/include / end=/$/ contained contains=@i3ConfigStrVar,i3ConfigIncludeCommand,i3ConfigShOper keepend
 
 " 4.2 Comments
-syn match i3ConfigComment /^\s*#.*$/ contained contains=i3ConfigTodo
+syn match i3ConfigComment /#.*$/ contained contains=i3ConfigTodo
 
 " 4.3 Fonts
 syn match i3ConfigFontSize / \d\+\(px\)\?$/ contained
@@ -64,7 +64,7 @@ syn region i3ConfigBind start=/\zs/ skip=/\\$/ end=/$/ contained contains=@i3Con
 syn keyword i3ConfigBindKeyword bindsym bindcode contained skipwhite nextgroup=i3ConfigBindArgument,i3ConfigBindCombo
 
 " 4.6 Binding modes
-syn region i3ConfigModeBlock matchgroup=i3ConfigKeyword start=/^mode\ze\( --pango_markup\)\? \([^'" {]\+\|'[^']\+'\|".\+"\)\s\+{$/ end=/^}\zs$/ contained contains=i3ConfigShParam,@i3ConfigStrVar,i3ConfigBindKeyword,i3ConfigComment,i3ConfigParen fold keepend extend
+syn region i3ConfigModeBlock matchgroup=i3ConfigKeyword start=/mode\ze\( --pango_markup\)\? \([^'" {]\+\|'[^']\+'\|".\+"\)\s\+{$/ end=/^}\zs$/ contained contains=i3ConfigShParam,@i3ConfigStrVar,i3ConfigBindKeyword,i3ConfigComment,i3ConfigParen fold keepend extend
 
 " 4.7 Floating modifier
 syn keyword i3ConfigKeyword floating_modifier contained skipwhite nextgroup=i3ConfigVariable,i3ConfigBindModkey
@@ -122,8 +122,8 @@ syn match  i3ConfigShDelim /[[\]{}();`]\+/ contained
 syn match  i3ConfigShOper /[<>&|+=~^*!.?]\+/ contained
 syn match i3ConfigShParam /\<-[A-Za-z-][0-9A-Za-z_-]*\>/ contained
 syn cluster i3ConfigSh contains=@i3ConfigIdent,i3ConfigShOper,i3ConfigShDelim,i3ConfigShParam,i3ConfigShCommand
-syn region i3ConfigExec start=/ [^{]/ skip=/\\$/ end=/$/ contained contains=i3ConfigExecAction,@i3ConfigSh keepend
-syn match i3ConfigKeyword /^\(exec_always\|exec\)/ contained nextgroup=i3ConfigExec
+syn region i3ConfigExec start=/ \ze[^{]/ skip=/\\$/ end=/$/ contained contains=i3ConfigExecAction,@i3ConfigSh keepend
+syn keyword i3ConfigKeyword exec_always exec contained nextgroup=i3ConfigExec
 
 " 4.21 Workspaces per output
 syn match i3ConfigOutputIdent /[^'",; ]\+/ contained contains=@i3ConfigIdent,i3ConfigColonOperator skipwhite nextgroup=i3ConfigOutputIdent
@@ -189,7 +189,7 @@ syn keyword i3ConfigBarOpts modifier contained skipwhite nextgroup=i3ConfigBindC
 syn keyword i3ConfigBarOpts i3bar_command status_command workspace_command contained skipwhite nextgroup=@i3ConfigSh
 syn keyword i3ConfigBarOpts mode hidden_state id position output tray_output tray_padding separator_symbol workspace_buttons workspace_min_width strip_workspace_numbers strip_workspace_name binding_mode_indicator padding contained skipwhite nextgroup=i3ConfigBarOptVals,@i3ConfigValue,i3ConfigShOper
 syn keyword i3ConfigBarOptVals dock hide invisible show none top bottom primary nonprimary contained
-syn region i3ConfigBarBlock matchgroup=i3ConfigKeyword start=/^bar\ze {$/ end=/^}\zs$/ contained contains=i3ConfigBarOpts,i3ConfigComment,i3ConfigParen,i3ConfigBindKeyword,i3ConfigColorsBlock fold keepend extend
+syn region i3ConfigBarBlock matchgroup=i3ConfigKeyword start=/bar\ze {$/ end=/^\s*}\zs$/ contained contains=i3ConfigBarOpts,i3ConfigComment,i3ConfigParen,i3ConfigBindKeyword,i3ConfigColorsBlock fold keepend extend
 
 " 5.16 Color block
 syn match i3ConfigColorSeq /#[0-9A-Fa-f]\{3,8}\|\$[0-9A-Za-z_:|[\]-]\+/ contained contains=@i3ConfigColVar skipwhite nextgroup=i3ConfigColorSeq
@@ -221,7 +221,7 @@ syn keyword i3ConfigFocusOpts left right up down parent child next prev sibling
 syn keyword i3ConfigOutputDir left right down up current primary nonprimary next prev contained skipwhite
 syn keyword i3ConfigFocusOutput output contained skipwhite nextgroup=i3ConfigOutputIdent,i3ConfigOutputDir
 syn keyword i3ConfigActionKeyword focus contained skipwhite nextgroup=i3ConfigFocusOpts,i3ConfigFocusOutput
-syn match i3ConfigKeyword /^focus / contained nextgroup=i3ConfigFocusOutput
+syn keyword i3ConfigKeyword focus skipwhite contained nextgroup=i3ConfigFocusOutput
 
 " 6.8 Focusing workspaces (4.21)
 syn keyword i3ConfigWorkspaceDir prev next back_and_forth contained
@@ -260,7 +260,7 @@ syn match i3ConfigMarkOpt /--\(add\|replace\)\( --toggle\)\?/ contained contains
 syn keyword i3ConfigActionKeyword mark contained skipwhite nextgroup=i3ConfigMarkOpt,i3ConfigOutputIdent
 
 " Commands usable for direct config calls - for enforcing start of line for Commands
-syn match i3ConfigTopLevelDirective /^/ skipwhite nextgroup=i3ConfigComment,i3ConfigKeyword,i3ConfigCommand,i3ConfigBindKeyword,i3ConfigParamLine,i3ConfigModeBlock,i3ConfigBarBlock,i3ConfigError
+syn match i3ConfigTopLevelDirective /^\s*/ nextgroup=i3ConfigComment,i3ConfigKeyword,i3ConfigCommand,i3ConfigBindKeyword,i3ConfigParamLine,i3ConfigModeBlock,i3ConfigBarBlock,i3ConfigError
 
 " Commands useable in keybinds
 syn keyword i3ConfigActionKeyword mode append_layout kill open fullscreen sticky split floating swap unmark title_window_icon title_format border restart reload exit scratchpad nop bar contained skipwhite nextgroup=i3ConfigOption,@i3ConfigValue
diff --git a/runtime/syntax/swayconfig.vim b/runtime/syntax/swayconfig.vim
index 55c52799b9..f1eba30a92 100644
--- a/runtime/syntax/swayconfig.vim
+++ b/runtime/syntax/swayconfig.vim
@@ -2,8 +2,8 @@
 " Language: sway config file
 " Original Author: Josef Litos (JosefLitos/i3config.vim)
 " Maintainer: James Eapen 
-" Version: 1.2.1
-" Last Change: 2024-04-14
+" Version: 1.2.2
+" Last Change: 2024-05-12
 
 " References:
 " http://i3wm.org/docs/userguide.html#configuring
@@ -16,10 +16,12 @@ if exists("b:current_syntax")
   finish
 endif
 
+" before i3 load to give i3ConfigKeyword lower priority
+syn cluster i3ConfigCommand contains=i3ConfigCommand,i3ConfigAction,i3ConfigActionKeyword,@i3ConfigValue,i3ConfigColor,i3ConfigKeyword
+
 runtime! syntax/i3config.vim
 
 " Sway extensions to i3
-syn cluster i3ConfigCommand contains=i3ConfigCommand,i3ConfigAction,i3ConfigActionKeyword,@i3ConfigValue,i3ConfigColor,i3ConfigKeyword
 syn keyword i3ConfigActionKeyword opacity urgent shortcuts_inhibitor splitv splith splitt contained contained skipwhite nextgroup=i3ConfigOption
 syn keyword i3ConfigOption set plus minus allow deny csd v h t contained contained skipwhite nextgroup=i3ConfigOption,@i3ConfigValue
 
@@ -32,12 +34,12 @@ syn region i3ConfigBindArgument start=/--input-device=['"]/ end=/\s/ contained c
 
 syn region i3ConfigBindCombo matchgroup=i3ConfigParen start=/{$/ end=/^\s*}$/ contained contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigComment fold keepend extend
 " hack for blocks with start outside parsing range
-syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*[$a-zA-Z0-9_+]\+ [a-z[]/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigParen keepend extend
+syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*\([A-Z$][$a-zA-Z0-9_+]\+\|[a-z]\) [a-z[]/ skip=/\\$\|$\n^\s*}$/ end=/$/ contains=i3ConfigBindArgument,i3ConfigBindCombo,i3ConfigParen keepend extend
 
-syn region i3ConfigExec start=/ {$/ end=/^}$/ contained contains=i3ConfigExecAction,@i3ConfigSh,i3ConfigComment fold keepend extend
+syn region i3ConfigExec start=/ {$/ end=/^\s*}$/ contained contains=i3ConfigExecAction,@i3ConfigSh,i3ConfigComment fold keepend extend
 
 syn keyword swayConfigFloatingModifierOpts normal inverse contained
-syn match i3ConfigKeyword /^floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts
+syn match i3ConfigKeyword /floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contained contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts
 
 syn match swayConfigI3Param /--i3/ contains=i3ConfigShParam skipwhite nextgroup=i3ConfigEdgeOpts
 syn keyword i3ConfigKeyword hide_edge_borders contained skipwhite nextgroup=swayConfigI3Param,i3ConfigEdgeOpts
@@ -81,7 +83,7 @@ syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*\(hold\|swipe\|pinc
 " Tiling drag threshold
 " Titlebar commands
 syn keyword i3ConfigKeyword tiling_drag_threshold titlebar_border_thickness contained skipwhite nextgroup=@i3ConfigNumVar
-syn match i3ConfigKeyword /^titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contains=@i3ConfigNumVar
+syn match i3ConfigKeyword /titlebar_padding \(\d\+\|\$\S\+\)\( \d\+\)\?$/ contained contains=@i3ConfigNumVar
 
 syn match swayConfigDeviceOper /[*:;!]/ contained
 
@@ -96,7 +98,7 @@ syn match swayConfigXkbOptsPair /[a-z]\+:/ contained contains=i3ConfigColonOpera
 syn keyword swayConfigInputOpts xkb_options contained skipwhite nextgroup=swayConfigXkbOptsPair
 
 syn region swayConfigInput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigInputOpts,@i3ConfigValue keepend
-syn region swayConfigInput matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigInputOpts,@i3ConfigValue,i3ConfigComment keepend extend
+syn region swayConfigInput matchgroup=i3ConfigParen start=/ {$/ end=/^\s*}$/ contained contains=swayConfigInputOpts,@i3ConfigValue,i3ConfigComment keepend extend
 syn keyword swayConfigInputType touchpad pointer keyboard touch tablet_tool tablet_pad switch contained nextgroup=swayConfigInput
 syn match swayConfigInputIdent /type:!\?/ contained contains=swayConfigDeviceOper nextgroup=swayConfigInputType
 syn match swayConfigInputIdent /[^t '"]\S*/ contained contains=i3ConfigOutputIdent nextgroup=swayConfigInput
@@ -111,7 +113,7 @@ syn keyword swayConfigSeatOpts attach contained skipwhite nextgroup=swayConfigSe
 syn match swayConfigSeatOptVals /when-typing/ contained skipwhite nextgroup=swayConfigSeatOptVals
 syn keyword swayConfigSeatOptVals move set press release none smart activate deactivate toggle escape enable disable contained skipwhite nextgroup=swayConfigSeatOpts
 syn region swayConfigSeat start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigSeatOpts,@i3ConfigValue keepend
-syn region swayConfigSeat matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigSeatOpts,@i3ConfigValue,i3ConfigComment keepend extend
+syn region swayConfigSeat matchgroup=i3ConfigParen start=/ {$/ end=/^\s*}$/ contained contains=swayConfigSeatOpts,@i3ConfigValue,i3ConfigComment keepend extend
 syn match swayConfigSeatIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent skipwhite nextgroup=swayConfigSeat
 syn keyword i3ConfigKeyword seat contained skipwhite nextgroup=swayConfigSeatIdent
 
@@ -127,7 +129,7 @@ syn match swayConfigOutputFPS /@[0-9.]\+Hz/ contained skipwhite nextgroup=swayCo
 syn match swayConfigOutputMode /\(--custom \)\?[0-9]\+x[0-9]\+/ contained contains=i3ConfigShParam skipwhite nextgroup=swayConfigOutputFPS,swayConfigOutputOpts
 syn match swayConfigOutputOptVals /\(flipped-\)\?\(90\|180\|270\)\|flipped\|normal/ contained contains=i3ConfigNumber skipwhite nextgroup=swayConfigOutputOptsVals
 syn region swayConfigOutput start=/\s/ skip=/\\$/ end=/\ze[,;]\|$/ contained contains=swayConfigOutputOpts,@i3ConfigValue keepend
-syn region swayConfigOutput matchgroup=i3ConfigParen start=/ {$/ end=/^}$/ contained contains=swayConfigOutputOpts,@i3ConfigValue,i3ConfigComment keepend extend
+syn region swayConfigOutput matchgroup=i3ConfigParen start=/ {$/ end=/^\s*}$/ contained contains=swayConfigOutputOpts,@i3ConfigValue,i3ConfigComment keepend extend
 syn match swayConfigOutputIdent /[^ ]\+/ contained contains=i3ConfigOutputIdent skipwhite nextgroup=swayConfigOutput
 syn keyword i3ConfigKeyword output contained skipwhite nextgroup=swayConfigOutputIdent
 
-- 
cgit 


From 521b9930b87cf5c4c853fc5080f5421d6bda23c9 Mon Sep 17 00:00:00 2001
From: Christian Clason 
Date: Thu, 23 May 2024 22:51:19 +0200
Subject: vim-patch:22ac941: runtime(i3config/swayconfig): support
 floating_modifier none; revert broken highlighting

- fix floating_modifier $mod normal|inverse was being hightlighted as error
  reverting the floating_modifier change from dd83b63
- will currently allow invalid syntax after floating_modifier

fixes: vim/vim#14826
closes: vim/vim#14827

https://github.com/vim/vim/commit/22ac941208fcb2c63ad172c6cf0b39b077b5b682

Co-authored-by: James Eapen 
Co-authored-by: JosefLitos 
---
 runtime/syntax/i3config.vim   | 6 +++---
 runtime/syntax/swayconfig.vim | 8 ++++----
 2 files changed, 7 insertions(+), 7 deletions(-)

(limited to 'runtime/syntax')

diff --git a/runtime/syntax/i3config.vim b/runtime/syntax/i3config.vim
index 7d01693c79..f4d789e418 100644
--- a/runtime/syntax/i3config.vim
+++ b/runtime/syntax/i3config.vim
@@ -2,8 +2,8 @@
 " Language: i3 config file
 " Original Author: Josef Litos (JosefLitos/i3config.vim)
 " Maintainer: Quentin Hibon (github user hiqua)
-" Version: 1.2.2
-" Last Change: 2024-04-14
+" Version: 1.2.3
+" Last Change: 2024-05-23
 
 " References:
 " http://i3wm.org/docs/userguide.html#configuring
@@ -67,7 +67,7 @@ syn keyword i3ConfigBindKeyword bindsym bindcode contained skipwhite nextgroup=i
 syn region i3ConfigModeBlock matchgroup=i3ConfigKeyword start=/mode\ze\( --pango_markup\)\? \([^'" {]\+\|'[^']\+'\|".\+"\)\s\+{$/ end=/^}\zs$/ contained contains=i3ConfigShParam,@i3ConfigStrVar,i3ConfigBindKeyword,i3ConfigComment,i3ConfigParen fold keepend extend
 
 " 4.7 Floating modifier
-syn keyword i3ConfigKeyword floating_modifier contained skipwhite nextgroup=i3ConfigVariable,i3ConfigBindModkey
+syn match i3ConfigKeyword /^floating_modifier [$0-9A-Za-z]*$/ contains=i3ConfigVariable,i3ConfigBindModkey
 
 " 4.8 Floating window size
 syn keyword i3ConfigSizeSpecial x contained
diff --git a/runtime/syntax/swayconfig.vim b/runtime/syntax/swayconfig.vim
index f1eba30a92..401412adfd 100644
--- a/runtime/syntax/swayconfig.vim
+++ b/runtime/syntax/swayconfig.vim
@@ -2,8 +2,8 @@
 " Language: sway config file
 " Original Author: Josef Litos (JosefLitos/i3config.vim)
 " Maintainer: James Eapen 
-" Version: 1.2.2
-" Last Change: 2024-05-12
+" Version: 1.2.3
+" Last Change: 2024-05-23
 
 " References:
 " http://i3wm.org/docs/userguide.html#configuring
@@ -38,8 +38,8 @@ syn region swayConfigBlockOrphan start=/^\s\+\(--[a-z-]\+ \)*\([A-Z$][$a-zA-Z0-9
 
 syn region i3ConfigExec start=/ {$/ end=/^\s*}$/ contained contains=i3ConfigExecAction,@i3ConfigSh,i3ConfigComment fold keepend extend
 
-syn keyword swayConfigFloatingModifierOpts normal inverse contained
-syn match i3ConfigKeyword /floating_modifier [$a-zA-Z0-9+]\+ \(normal\|inverse\)$/ contained contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts
+syn keyword swayConfigFloatingModifierOpts normal inverse none contained
+syn match i3ConfigKeyword /floating_modifier \(none\|[$a-zA-Z0-9+]\+ \(normal\|inverse\)\)$/ contained contains=i3ConfigVariable,i3ConfigBindModkey,swayConfigFloatingModifierOpts
 
 syn match swayConfigI3Param /--i3/ contains=i3ConfigShParam skipwhite nextgroup=i3ConfigEdgeOpts
 syn keyword i3ConfigKeyword hide_edge_borders contained skipwhite nextgroup=swayConfigI3Param,i3ConfigEdgeOpts
-- 
cgit