vim: fix comment syntax pattern

Only lines which contain (optional) whitespace followed by a # character
are comments. We should not treat lines like "foreground = #aaa" as
containing a comment.
This commit is contained in:
Gregory Anders
2024-11-18 16:08:20 -06:00
parent e54ae31d1c
commit bc6cd631e5
2 changed files with 2 additions and 2 deletions

View File

@ -14,7 +14,7 @@ const Template = struct {
\\contexts:
\\ main:
\\ # Comments
\\ - match: '#.*$'
\\ - match: '^\s*#.*$'
\\ scope: comment.line.number-sign.ghostty
\\
\\ # Keywords

View File

@ -70,7 +70,7 @@ fn writeSyntax(writer: anytype) !void {
try writer.writeAll(
\\
\\
\\syn match ghosttyConfigComment /#.*/ contains=@Spell
\\syn match ghosttyConfigComment /^\s*#.*/ contains=@Spell
\\
\\hi def link ghosttyConfigComment Comment
\\hi def link ghosttyConfigKeyword Keyword