From: Peter Kenny Date: Sun, 15 Feb 2026 15:59:36 +0000 (+0000) Subject: runtime(vim): Error codes should not be highlighed with vim9CommentTitle X-Git-Tag: v9.2.0005~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3794d9b33ce32492b84565d55a538bcfc1fcfbb6;p=thirdparty%2Fvim.git runtime(vim): Error codes should not be highlighed with vim9CommentTitle closes: #19390 Signed-off-by: Peter Kenny Signed-off-by: Christian Brabandt --- diff --git a/runtime/syntax/generator/vim.vim.base b/runtime/syntax/generator/vim.vim.base index 0a4da554a8..dc25ea245e 100644 --- a/runtime/syntax/generator/vim.vim.base +++ b/runtime/syntax/generator/vim.vim.base @@ -2340,7 +2340,7 @@ Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\%(\\\|#\\ \) VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\%(\\\|"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup -syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup +syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\%([A-DF-Z]\w*\|E\%(\d\{1,4}\>\)\@!\w*\)\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup " allowed anywhere in the file if !s:vim9script diff --git a/runtime/syntax/testdir/dumps/vim9_comments_01.dump b/runtime/syntax/testdir/dumps/vim9_comments_01.dump index da29430fd8..4a2795dbe2 100644 --- a/runtime/syntax/testdir/dumps/vim9_comments_01.dump +++ b/runtime/syntax/testdir/dumps/vim9_comments_01.dump @@ -17,4 +17,4 @@ @75 |#+0#0000e05&| |M|u|l|t|i|l|i|n|e| |c|o|m@1|e|n|t|s| +0#0000000&@54 @75 -@57|1|9|,|0|-|1| @7|1|7|%| +@57|1|9|,|0|-|1| @7|1|6|%| diff --git a/runtime/syntax/testdir/dumps/vim9_comments_02.dump b/runtime/syntax/testdir/dumps/vim9_comments_02.dump index 23ecd7e246..34e51d71ac 100644 --- a/runtime/syntax/testdir/dumps/vim9_comments_02.dump +++ b/runtime/syntax/testdir/dumps/vim9_comments_02.dump @@ -17,4 +17,4 @@ @75 |#+0#0000e05&| |L|i|n|e|-|c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t|s| +0#0000000&@46 @75 -@57|3|7|,|1| @9|4|2|%| +@57|3|7|,|1| @9|3|8|%| diff --git a/runtime/syntax/testdir/dumps/vim9_comments_03.dump b/runtime/syntax/testdir/dumps/vim9_comments_03.dump index b28daf4724..7eb54fa592 100644 --- a/runtime/syntax/testdir/dumps/vim9_comments_03.dump +++ b/runtime/syntax/testdir/dumps/vim9_comments_03.dump @@ -17,4 +17,4 @@ @2|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63 |}+0#e000e06&| +0#0000000&|#+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@63 @75 -@57|5@1|,|7| @9|6|7|%| +@57|5@1|,|7| @9|6|1|%| diff --git a/runtime/syntax/testdir/dumps/vim9_comments_04.dump b/runtime/syntax/testdir/dumps/vim9_comments_04.dump index e5606ee7b4..3572cb34bf 100644 --- a/runtime/syntax/testdir/dumps/vim9_comments_04.dump +++ b/runtime/syntax/testdir/dumps/vim9_comments_04.dump @@ -17,4 +17,4 @@ |#+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|p|u|l@1|/|1|4|9|7|5|#|i|s@1|u|e|c|o|m@1|e|n|t|-|2|8|3|2|6|4|3|1@1|5| +0#0000000&@11 @75 |v+0#af5f00255&|a|r| +0#0000000&|d+0#00e0e07&| +0#0000000&|=+0#af5f00255&| +0#0000000&|{+0#e000e06&| +0#0000000&@65 -@57|7|3|,|3| @9|9|1|%| +@57|7|3|,|3| @9|8|3|%| diff --git a/runtime/syntax/testdir/dumps/vim9_comments_05.dump b/runtime/syntax/testdir/dumps/vim9_comments_05.dump index 34ced4c29f..e7d14e588a 100644 --- a/runtime/syntax/testdir/dumps/vim9_comments_05.dump +++ b/runtime/syntax/testdir/dumps/vim9_comments_05.dump @@ -5,16 +5,16 @@ |b+0#00e0e07&|:| +0#0000000&|0+0#e000002&|,+0#0000000&| @69 >}+0#e000e06&| +0#0000000&@73 @75 +@75 +|#+0#0000e05&| +0#0000000&|P+0#e000e06&|R|:| +0#0000e05&|#|1|9|3|9|0| +0#0000000&@62 +|#+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|p|u|l@1|/|1|9|3|9|0|#|i|s@1|u|e|-|3|9|3@1|7|5@1|8|4|6| +0#0000000&@18 +@75 +|#+0#0000e05&| |E|1|2|3|4|:| |s|h|o|u|l|d| |n|o|t| |h|a|v|e| |v|i|m|9|C|o|m@1|e|n|t|T|i|t|l|e| |o|n| |'|E|1|2|3|4|:|'| +0#0000000&@21 +|#+0#0000e05&| +0#0000000&|E+0#e000e06&|R@1|3|4|:| +0#0000e05&|s|h|o|u|l|d| |h|a|v|e| |v|i|m|9|C|o|m@1|e|n|t|T|i|t|l|e| |o|n| |'|E|R@1|3|4|:|'| +0#0000000&@25 +@75 |~+0#4040ff13&| @73 |~| @73 |~| @73 |~| @73 |~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 | +0#0000000&@56|9|1|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/dumps/vim_comments_01.dump b/runtime/syntax/testdir/dumps/vim_comments_01.dump index c439d335b9..2c52e515da 100644 --- a/runtime/syntax/testdir/dumps/vim_comments_01.dump +++ b/runtime/syntax/testdir/dumps/vim_comments_01.dump @@ -17,4 +17,4 @@ @75 |"+0#0000e05&| |c|o|m@1|e|n|t| +0#0000000&@65 | +0#0000e05&@1|\| |c|o|n|t|i|n|u|i|n|g| |c|o|m@1|e|n|t| +0#0000000&@52 -@57|1|9|,|3| @9|2|3|%| +@57|1|9|,|3| @9|2|0|%| diff --git a/runtime/syntax/testdir/dumps/vim_comments_02.dump b/runtime/syntax/testdir/dumps/vim_comments_02.dump index ee568be945..5156e42793 100644 --- a/runtime/syntax/testdir/dumps/vim_comments_02.dump +++ b/runtime/syntax/testdir/dumps/vim_comments_02.dump @@ -17,4 +17,4 @@ @75 |:|F|o@1| @70 @6|"+0#0000e05&|\| |l|i|n|e| |c|o|n|t|i|n|u|a|t|i|o|n| |c|o|m@1|e|n|t| +0#0000000&@40 -@57|3|7|,|3| @9|5|6|%| +@57|3|7|,|3| @9|4|8|%| diff --git a/runtime/syntax/testdir/dumps/vim_comments_03.dump b/runtime/syntax/testdir/dumps/vim_comments_03.dump index fba406f9d4..a125c0bb18 100644 --- a/runtime/syntax/testdir/dumps/vim_comments_03.dump +++ b/runtime/syntax/testdir/dumps/vim_comments_03.dump @@ -17,4 +17,4 @@ |"+0#0000e05&| |T|h|i|s| |i|s| |w|h|a|t| |w|e| |c|a|l@1| |"| |b|l|a|h| +0#0000000&@45 @75 @75 -@57|5@1|,|0|-|1| @7|8|9|%| +@57|5@1|,|0|-|1| @7|7|6|%| diff --git a/runtime/syntax/testdir/dumps/vim_comments_04.dump b/runtime/syntax/testdir/dumps/vim_comments_04.dump index 645d45b642..48acc83f63 100644 --- a/runtime/syntax/testdir/dumps/vim_comments_04.dump +++ b/runtime/syntax/testdir/dumps/vim_comments_04.dump @@ -5,16 +5,16 @@ @2|#+0#0000e05&| +0#0000000&|T+0#e000e06&|i|t|l|e|:| +0#0000e05&|.@2| +0#0000000&@60 >e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 @75 +@75 +|"+0#0000e05&| +0#0000000&|P+0#e000e06&|R|:| +0#0000e05&|#|1|9|3|9|0| +0#0000000&@62 +|"+0#0000e05&| |h|t@1|p|s|:|/@1|g|i|t|h|u|b|.|c|o|m|/|v|i|m|/|v|i|m|/|p|u|l@1|/|1|9|3|9|0|#|i|s@1|u|e|-|3|9|3@1|7|5@1|8|4|6| +0#0000000&@18 +@75 +|d+0#af5f00255&|e|f| +0#0000000&|C|o|m@1|e|n|t|T|i|t|l|e|2|(+0#e000e06&|)| +0#0000000&@55 +@2|#+0#0000e05&| |E|1|2|3|4|:| |s|h|o|u|l|d| |n|o|t| |h|a|v|e| |v|i|m|9|C|o|m@1|e|n|t|T|i|t|l|e| |o|n| |'|E|1|2|3|4|:|'| +0#0000000&@19 +@2|#+0#0000e05&| +0#0000000&|E+0#e000e06&|R@1|3|4|:| +0#0000e05&|s|h|o|u|l|d| |h|a|v|e| |v|i|m|9|C|o|m@1|e|n|t|T|i|t|l|e| |o|n| |'|E|R@1|3|4|:|'| +0#0000000&@23 +|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68 +@75 |~+0#4040ff13&| @73 |~| @73 |~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 -|~| @73 | +0#0000000&@56|7|3|,|1| @9|B|o|t| diff --git a/runtime/syntax/testdir/input/vim9_comments.vim b/runtime/syntax/testdir/input/vim9_comments.vim index 1842d7ef74..360bb57833 100644 --- a/runtime/syntax/testdir/input/vim9_comments.vim +++ b/runtime/syntax/testdir/input/vim9_comments.vim @@ -90,3 +90,10 @@ var d = { b: 0, } + +# PR: #19390 +# https://github.com/vim/vim/pull/19390#issue-3933755846 + +# E1234: should not have vim9CommentTitle on 'E1234:' +# ERR34: should have vim9CommentTitle on 'ERR34:' + diff --git a/runtime/syntax/testdir/input/vim_comments.vim b/runtime/syntax/testdir/input/vim_comments.vim index 0cababe111..6c1f990a05 100644 --- a/runtime/syntax/testdir/input/vim_comments.vim +++ b/runtime/syntax/testdir/input/vim_comments.vim @@ -72,3 +72,12 @@ def CommentTitle() # Title: ... enddef + +" PR: #19390 +" https://github.com/vim/vim/pull/19390#issue-3933755846 + +def CommentTitle2() + # E1234: should not have vim9CommentTitle on 'E1234:' + # ERR34: should have vim9CommentTitle on 'ERR34:' +enddef + diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index 22f563fafd..39f357848c 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2026 Jan 30 +" Last Change: 2026 Feb 13 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -2403,7 +2403,7 @@ Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\%(\\\|#\\ \) VimL syn region vimLineComment start=+^[ \t:]*\zs".*$+ skip=+\n\s*\%(\\\|"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString,vimCommentTitle extend syn match vimCommentTitle '"\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vimCommentTitleLeader,vimTodo,@vimCommentGroup -syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\u\w*\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup +syn match vim9CommentTitle '#\s*\%([sS]:\|\h\w*#\)\=\%([A-DF-Z]\w*\|E\%(\d\{1,4}\>\)\@!\w*\)\(\s\+\u\w*\)*:'hs=s+1 contained contains=vim9CommentTitleLeader,vimTodo,@vimCommentGroup " allowed anywhere in the file if !s:vim9script