runtime(vim): Error codes should not be highlighed with vim9CommentTitle
Commit:
https://github.com/vim/vim/commit/3794d9b33ce32492b84565d55a538bcfc1fcfbb6
Author: Peter Kenny <[email protected]>
Date: Sun Feb 15 15:59:36 2026 +0000
runtime(vim): Error codes should not be highlighed with vim9CommentTitle
closes: https://github.com/vim/vim/issues/19390
Signed-off-by: Peter Kenny <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/runtime/syntax/generator/vim.vim.base
b/runtime/syntax/generator/vim.vim.base
index 0a4da554a..dc25ea245 100644
--- a/runtime/syntax/generator/vim.vim.base
+++ b/runtime/syntax/generator/vim.vim.base
@@ -2340,7 +2340,7 @@ Vim9 syn region vim9LineComment start=+^[
:]*\zs#.*$+ skip=+
\s*\%(\\|#\ \)
VimL syn region vimLineComment start=+^[ :]*\zs".*$+ skip=+
\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 da29430fd..4a2795dbe 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 23ecd7e24..34e51d71a 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 b28daf472..7eb54fa59 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 e5606ee7b..3572cb34b 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 34ced4c29..e7d14e588 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 c439d335b..2c52e515d 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 ee568be94..5156e4279 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 fba406f9d..a125c0bb1 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 645d45b64..48acc83f6 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 1842d7ef7..360bb5783 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 0cababe11..6c1f990a0 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 22f563faf..39f357848 100644
--- a/runtime/syntax/vim.vim
+++ b/runtime/syntax/vim.vim
@@ -2,7 +2,7 @@
" Language: Vim script
" Maintainer: Hirohito Higashi <h.east.727 ATMARK gmail.com>
" Doug Kearns <[email protected]>
-" 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=+^[
:]*\zs#.*$+ skip=+
\s*\%(\\|#\ \)
VimL syn region vimLineComment start=+^[ :]*\zs".*$+ skip=+
\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
--
--
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 [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vreXU-00Df2l-TP%40256bit.org.