From bc6cd631e52cbe3506c066b74ec0614c140e4331 Mon Sep 17 00:00:00 2001 From: Gregory Anders Date: Mon, 18 Nov 2024 16:08:20 -0600 Subject: [PATCH] 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. --- src/config/sublime_syntax.zig | 2 +- src/config/vim.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/config/sublime_syntax.zig b/src/config/sublime_syntax.zig index 1b7c4900a..18167fee6 100644 --- a/src/config/sublime_syntax.zig +++ b/src/config/sublime_syntax.zig @@ -14,7 +14,7 @@ const Template = struct { \\contexts: \\ main: \\ # Comments - \\ - match: '#.*$' + \\ - match: '^\s*#.*$' \\ scope: comment.line.number-sign.ghostty \\ \\ # Keywords diff --git a/src/config/vim.zig b/src/config/vim.zig index 43ad9fa63..d048fc990 100644 --- a/src/config/vim.zig +++ b/src/config/vim.zig @@ -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