]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Error codes should not be highlighed with vim9CommentTitle
authorPeter Kenny <github.com@k1w1.cyou>
Sun, 15 Feb 2026 15:59:36 +0000 (15:59 +0000)
committerChristian Brabandt <cb@256bit.org>
Sun, 15 Feb 2026 15:59:36 +0000 (15:59 +0000)
closes: #19390

Signed-off-by: Peter Kenny <github.com@k1w1.cyou>
Signed-off-by: Christian Brabandt <cb@256bit.org>
13 files changed:
runtime/syntax/generator/vim.vim.base
runtime/syntax/testdir/dumps/vim9_comments_01.dump
runtime/syntax/testdir/dumps/vim9_comments_02.dump
runtime/syntax/testdir/dumps/vim9_comments_03.dump
runtime/syntax/testdir/dumps/vim9_comments_04.dump
runtime/syntax/testdir/dumps/vim9_comments_05.dump
runtime/syntax/testdir/dumps/vim_comments_01.dump
runtime/syntax/testdir/dumps/vim_comments_02.dump
runtime/syntax/testdir/dumps/vim_comments_03.dump
runtime/syntax/testdir/dumps/vim_comments_04.dump
runtime/syntax/testdir/input/vim9_comments.vim
runtime/syntax/testdir/input/vim_comments.vim
runtime/syntax/vim.vim

index 0a4da554a885b1966f11c31a3011d1670a976f3e..dc25ea245e66f9f9f401270f91514d759593d7f7 100644 (file)
@@ -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
index da29430fd8cc4ba22088666cb3cf7f5568a9f3d2..4a2795dbe2b5ac439a24e047af7a4d8a4daf1d6d 100644 (file)
@@ -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|%| 
index 23ecd7e2467bd937ebc200a84957462d690ad4ce..34e51d71ac7eb710e59a920f38fc2dda97e497dd 100644 (file)
@@ -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|%| 
index b28daf47241af8925ab26bc07de2497def9fe4b0..7eb54fa592821455a12b3a7eeba631cf6dd98452 100644 (file)
@@ -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|%| 
index e5606ee7b43f697633d6660d1553534942860719..3572cb34bf25a01d6ea22d6ee468bffb64a386df 100644 (file)
@@ -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|%| 
index 34ced4c29f4271d03c4c5fa64511ef2938a62c8e..e7d14e588a7b39962db8917d1bb0eaa71deb8f0e 100644 (file)
@@ -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| 
index c439d335b92d99b634d822dba5515c178c0a5ac0..2c52e515da77bdb8c1c9fb32150e7a30cd67f21b 100644 (file)
@@ -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|%| 
index ee568be945fc2477b9127ef07311cb15d7f5fdd8..5156e42793c4832898fa0a6250d4cbeaa9b609d3 100644 (file)
@@ -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|%| 
index fba406f9d4439f67586b2761510ed8a3102df44f..a125c0bb18061cfb09e2b943551735016d40896b 100644 (file)
@@ -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|%| 
index 645d45b64238dc2c761fb1591c117d038fc38359..48acc83f6330e9f578b79079286d7ffa389d28c9 100644 (file)
@@ -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| 
index 1842d7ef745c23e70883bcbb778b63b76872f990..360bb57833ada6db29e9158a8c1063f2596ba625 100644 (file)
@@ -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:'
+
index 0cababe11189f94466077c19527f1a0f7c1b8b1b..6c1f990a055b5ddad7cc2b6a0355251a2fcf7de1 100644 (file)
@@ -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
+
index 22f563fafd129554e586af973e2581ddcc94ad5d..39f357848c7a0cbe8b6a694c0326b569a64030cb 100644 (file)
@@ -2,7 +2,7 @@
 " Language:       Vim script
 " Maintainer:     Hirohito Higashi <h.east.727 ATMARK gmail.com>
 "         Doug Kearns <dougkearns@gmail.com>
-" 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