runtime(vim): vimHLGroup is not highlighted correctly Commit: https://github.com/vim/vim/commit/834bb85172e2fe541dfd3064866a91840280562a Author: Eisuke Kawashima <e-k...@users.noreply.github.com> Date: Sat Jun 7 17:59:11 2025 +0200
runtime(vim): vimHLGroup is not highlighted correctly Problem: vimHLGroup is not highlighted in "hi def link" and "hi clear" commands Solution: highlight vimHLGroup similarly to vimGroup (Eisuke Kawashima) closes: #17450 Signed-off-by: Eisuke Kawashima <e-k...@users.noreply.github.com> Signed-off-by: Doug Kearns <dougkea...@gmail.com> Signed-off-by: Christian Brabandt <c...@256bit.org> diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index d5a52f055..0cfa300ad 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -1561,7 +1561,7 @@ syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 -syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment +syn cluster vimHiCluster contains=vimGroup,vimHLGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment syn region vimHiKeyList contained start="\i\+" skip=+\\\|\|\| \s*\\| \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 @@ -1579,7 +1579,7 @@ syn match vimHiTermcap contained "\S\+" contains=vimNotation syn match vimHiNmbr contained '\d\+' " Highlight: clear {{{2 -syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup +syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup " Highlight: link {{{2 " see tst24 (hi def vs hi) (Jul 06, 2018) diff --git a/runtime/syntax/testdir/dumps/vim_ex_highlight_00.dump b/runtime/syntax/testdir/dumps/vim_ex_highlight_00.dump index ff9c0c5db..fb3331452 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_highlight_00.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_highlight_00.dump @@ -9,6 +9,7 @@ @75 |"+0#0000e05&| |d|i|s|a|b|l|e| +0#0000000&@65 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|c+0#00e0003&|l|e|a|r| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@51 +|h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|c+0#00e0003&|l|e|a|r| +0#0000000&|E+0#00e0003&|r@1|o|r|M|s|g| +0#0000000&@50 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|N+0#00e0003&|O|N|E| +0#0000000&@52 @75 |"+0#0000e05&| |a|d@1|/|m|o|d|i|f|y| +0#0000000&@62 @@ -16,5 +17,4 @@ |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|t+0#00e0003&|e|r|m|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&@39 @75 |"+0#0000e05&| |l|i|n|k| +0#0000000&@68 -|h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@48 @57|1|,|1| @10|T|o|p| diff --git a/runtime/syntax/testdir/dumps/vim_ex_highlight_01.dump b/runtime/syntax/testdir/dumps/vim_ex_highlight_01.dump index e9c825710..6454f5561 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_highlight_01.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_highlight_01.dump @@ -1,20 +1,20 @@ -|"+0#0000e05#ffffff0| |a|d@1|/|m|o|d|i|f|y| +0#0000000&@62 +| +0&#ffffff0@74 +|"+0#0000e05&| |a|d@1|/|m|o|d|i|f|y| +0#0000000&@62 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|c+0#00e0003&|t|e|r|m|=+0#0000000&|u+0#e000e06&|n|d|e|r|l|i|n|e| +0#0000000&@41 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|t+0#00e0003&|e|r|m|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&@39 @75 -|"+0#0000e05&| |l|i|n|k| +0#0000000&@68 ->h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@48 +>"+0#0000e05&| |l|i|n|k| +0#0000000&@68 +|h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@48 |h+0#af5f00255&|i|g|h|l|i|g|h|t|!| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@47 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |N+0#00e0003&|O|N|E| +0#0000000&@51 |h+0#af5f00255&|i|g|h|l|i|g|h|t|!| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |N+0#00e0003&|O|N|E| +0#0000000&@50 +|h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |E+0#00e0003&|r@1|o|r|M|s|g| +0#0000000&@47 +|h+0#af5f00255&|i|g|h|l|i|g|h|t|!| +0#0000000&|l+0#00e0003&|i|n|k| +0#0000000&|F|o@1| |E+0#00e0003&|r@1|o|r|M|s|g| +0#0000000&@46 @75 |"+0#0000e05&| |d|e|f|a|u|l|t| |l|i|n|k| +0#0000000&@60 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@40 |h+0#af5f00255&|i|g|h|l|i|g|h|t|!| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@39 |h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |N+0#00e0003&|O|N|E| +0#0000000&@43 |h+0#af5f00255&|i|g|h|l|i|g|h|t|!| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |N+0#00e0003&|O|N|E| +0#0000000&@42 -@75 -@75 -|"+0#0000e05&| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |a|n|d| |c|o|m@1|a|n|d| |s|e|p|a|r|a|t|o|r| +0#0000000&@33 -@75 -@57|1|9|,|1| @9|3|6|%| +|h+0#af5f00255&|i|g|h|l|i|g|h|t| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |E+0#00e0003&|r@1|o|r|M|s|g| +0#0000000&@39 +@57|1|9|,|1| @9|3|1|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_highlight_02.dump b/runtime/syntax/testdir/dumps/vim_ex_highlight_02.dump index ce26bc1ad..3c71c7c6e 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_highlight_02.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_highlight_02.dump @@ -1,9 +1,14 @@ -| +0&#ffffff0@74 +|h+0#af5f00255#ffffff0|i|g|h|l|i|g|h|t| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |E+0#00e0003&|r@1|o|r|M|s|g| +0#0000000&@39 +|h+0#af5f00255&|i|g|h|l|i|g|h|t|!| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&|F|o@1| |E+0#00e0003&|r@1|o|r|M|s|g| +0#0000000&@38 +@75 +@75 +|"+0#0000e05&| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |a|n|d| |c|o|m@1|a|n|d| |s|e|p|a|r|a|t|o|r| +0#0000000&@33 +> @74 |h+0#af5f00255&|i| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@64 @6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 @6|\+0#e000e06&| +0#0000000&|t+0#00e0003&|e|r|m|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&@57 @6|"+0#0000e05&|\| |c|o|m@1|e|n|t| +0#0000000&@58 -@6>\+0#e000e06&| +0#0000000&|c+0#00e0003&|t|e|r|m|f|g|=+0#0000000&|C+0#e000002&|y|a|n| +0#0000000&@54 +@6|\+0#e000e06&| +0#0000000&|c+0#00e0003&|t|e|r|m|f|g|=+0#0000000&|C+0#e000002&|y|a|n| +0#0000000&@54 @6|\+0#e000e06&| +0#0000000&|g+0#00e0003&|u|i|f|g|=+0#0000000&|#+0#e000002&|8|0|a|0|f@1| +0#0000000&@53 @6|\+0#e000e06&| +0#0000000&|g+0#00e0003&|u|i|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&@58 @75 @@ -12,9 +17,4 @@ @6|\+0#e000e06&| +0#0000000&|c+0#00e0003&|t|e|r|m|f|g|=+0#0000000&|C+0#e000002&|y|a|n| +0#0000000&@54 @6|\+0#e000e06&| +0#0000000&|g+0#00e0003&|u|i|f|g|=+0#0000000&|#+0#e000002&|8|0|a|0|f@1| +0#0000000&@53 @6|\+0#e000e06&| +0#0000000&|g+0#00e0003&|u|i|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@45 -@75 -|h+0#af5f00255&|i| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|t+0#00e0003&|e|r|m|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&|c+0#00e0003&|t|e|r|m|f|g|=+0#0000000&|C+0#e000002&|y|a|n| +0#0000000&|g+0#00e0003&|u|i|f|g|=+0#0000000&|#+0#e000002&|8|0|a|0|f@1| +0#0000000&|g+0#00e0003&|u|i|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@5 -@75 -|h+0#af5f00255&|i| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&@59 -@6|\+0#e000e06&| +0#0000000&|F|o@1| @63 -@57|3|7|,|7| @9|8|6|%| +@57|3|7|,|0|-|1| @7|7|5|%| diff --git a/runtime/syntax/testdir/dumps/vim_ex_highlight_03.dump b/runtime/syntax/testdir/dumps/vim_ex_highlight_03.dump index 0ba712e0e..e30644389 100644 --- a/runtime/syntax/testdir/dumps/vim_ex_highlight_03.dump +++ b/runtime/syntax/testdir/dumps/vim_ex_highlight_03.dump @@ -1,9 +1,14 @@ -| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|F|o@1| @63 +| +0&#ffffff0@5|\+0#e000e06&| +0#0000000&|g+0#00e0003&|u|i|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@45 +@75 +|h+0#af5f00255&|i| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&|t+0#00e0003&|e|r|m|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&|c+0#00e0003&|t|e|r|m|f|g|=+0#0000000&|C+0#e000002&|y|a|n| +0#0000000&|g+0#00e0003&|u|i|f|g|=+0#0000000&|#+0#e000002&|8|0|a|0|f@1| +0#0000000&|g+0#00e0003&|u|i|=+0#0000000&|b+0#e000e06&|o|l|d| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@5 +@75 +|h+0#af5f00255&|i| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&@59 +@6>\+0#e000e06&| +0#0000000&|F|o@1| @63 @6|\+0#e000e06&| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&@59 @75 |h+0#af5f00255&|i| +0#0000000&|d+0#00e0003&|e|f|a|u|l|t| |l|i|n|k| +0#0000000&@59 @6|\+0#e000e06&| +0#0000000&|F|o@1| @63 -@6>\+0#e000e06&| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@46 +@6|\+0#e000e06&| +0#0000000&|C+0#00e0003&|o|m@1|e|n|t| +0#0000000&||| |e+0#af5f00255&|c|h|o| +0#0000000&|"+0#e000002&|F|o@1|"| +0#0000000&@46 |~+0#4040ff13&| @73 |~| @73 |~| @73 @@ -12,9 +17,4 @@ |~| @73 |~| @73 |~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 | +0#0000000&@56|5@1|,|7| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim_ex_highlight.vim b/runtime/syntax/testdir/input/vim_ex_highlight.vim index e23968aa5..ecfea4adc 100644 --- a/runtime/syntax/testdir/input/vim_ex_highlight.vim +++ b/runtime/syntax/testdir/input/vim_ex_highlight.vim @@ -9,6 +9,7 @@ highlight clear " disable highlight clear Comment +highlight clear ErrorMsg highlight Comment NONE " add/modify @@ -20,12 +21,16 @@ highlight link Foo Comment highlight! link Foo Comment highlight link Foo NONE highlight! link Foo NONE +highlight link Foo ErrorMsg +highlight! link Foo ErrorMsg " default link highlight default link Foo Comment highlight! default link Foo Comment highlight default link Foo NONE highlight! default link Foo NONE +highlight default link Foo ErrorMsg +highlight! default link Foo ErrorMsg " line continuation and command separator diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 3eafe1e7a..2d7493a8e 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -1622,7 +1622,7 @@ syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 -syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment +syn cluster vimHiCluster contains=vimGroup,vimHLGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment syn region vimHiKeyList contained start="\i\+" skip=+\\\|\|\| \s*\\| \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 @@ -1640,7 +1640,7 @@ syn match vimHiTermcap contained "\S\+" contains=vimNotation syn match vimHiNmbr contained '\d\+' " Highlight: clear {{{2 -syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup +syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup " Highlight: link {{{2 " see tst24 (hi def vs hi) (Jul 06, 2018) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/vim_dev/E1uNwCH-005hle-0o%40256bit.org.