Skip to content

Commit 7c3b65e

Browse files
committed
runtime(cfg): only consider leading // as starting a comment
fixes: #16051 Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent bc32bbd commit 7c3b65e

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

runtime/syntax/cfg.vim

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
" Language: Good old CFG files
33
" Maintainer: Igor N. Prischepoff (igor@tyumbit.ru, pri_igor@mail.ru)
44
" Last change: 2012 Aug 11
5+
" 2024 Nov 14 by Vim project: // only denotes a comment when starting a line (#16051)
56

67
" quit when a syntax file was already loaded
78
if exists ("b:current_syntax")
@@ -27,17 +28,17 @@ syn match CfgSection "{.*}"
2728
syn match CfgString "\".*\"" contained
2829
syn match CfgString "'.*'" contained
2930

30-
" Comments (Everything before '#' or '//' or ';')
31+
" Comments (Everything before '#' or ';' or leading '//')
3132
syn match CfgComment "#.*"
3233
syn match CfgComment ";.*"
33-
syn match CfgComment "\/\/.*"
34+
syn match CfgComment "^\s*\/\/.*"
3435

3536
" Define the default highlighting.
3637
" Only when an item doesn't have highlighting yet
3738
hi def link CfgOnOff Label
38-
hi def link CfgComment Comment
39-
hi def link CfgSection Type
40-
hi def link CfgString String
39+
hi def link CfgComment Comment
40+
hi def link CfgSection Type
41+
hi def link CfgString String
4142
hi def link CfgParams Keyword
4243
hi def link CfgValues Constant
4344
hi def link CfgDirectory Directory

0 commit comments

Comments
 (0)