From b76e78a95640648ad207487286a34e3db421db61 Mon Sep 17 00:00:00 2001 From: Adam Saponara Date: Fri, 13 Dec 2024 20:27:22 -0500 Subject: [PATCH] adjust hash-comment syntax rule --- editor.c | 2 +- tests/func/test_syntax.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/editor.c b/editor.c index 976a952..dc7cd55 100644 --- a/editor.c +++ b/editor.c @@ -2187,7 +2187,7 @@ static void _editor_init_syntaxes(editor_t *editor) { { "`([^`\\\\]|\\\\.)*`", NULL, TB_YELLOW | TB_BOLD, TB_DEFAULT }, { "/\\*", "\\*/", TB_CYAN, TB_DEFAULT }, { "//.*$", NULL, TB_CYAN, TB_DEFAULT }, - { "(?<=(\\s|^))#\\s.*$", NULL, TB_CYAN, TB_DEFAULT }, + { "(?<=(\\s|^))#(\\s.*)?$", NULL, TB_CYAN, TB_DEFAULT }, { "^#!/.*$", NULL, TB_CYAN, TB_DEFAULT }, { "[(){}<>\\[\\].,;:?!+=/\\\\%^*-]", NULL, TB_RED | TB_BOLD, TB_DEFAULT }, { "(?$tmpf <<"EOD" # ccc +# aaa "bbb" // ccc "ccc" aaa "bbb" # ccc "ccc" EOD @@ -83,11 +84,13 @@ extra_opts=(-yy $tmpf) macro='' declare -A expected declare -A not_expected -# a==97 b==98 c==99 +# a==97 b==98 c==99 #=35 expected[style_a]='