Skip to content

Commit f5a00a4

Browse files
committed
highlight # ... as comment at beginning of line in syn_generic
1 parent 6ff6caf commit f5a00a4

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

editor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2187,7 +2187,7 @@ static void _editor_init_syntaxes(editor_t *editor) {
21872187
{ "`([^`\\\\]|\\\\.)*`", NULL, TB_YELLOW | TB_BOLD, TB_DEFAULT },
21882188
{ "/\\*", "\\*/", TB_CYAN, TB_DEFAULT },
21892189
{ "//.*$", NULL, TB_CYAN, TB_DEFAULT },
2190-
{ "(?<=\\s)#\\s.*$", NULL, TB_CYAN, TB_DEFAULT },
2190+
{ "(?<=(\\s|^))#\\s.*$", NULL, TB_CYAN, TB_DEFAULT },
21912191
{ "^#!/.*$", NULL, TB_CYAN, TB_DEFAULT },
21922192
{ "[(){}<>\\[\\].,;:?!+=/\\\\%^*-]", NULL, TB_RED | TB_BOLD, TB_DEFAULT },
21932193
{ "(?<!\\w)[\\%@$][a-zA-Z_$][a-zA-Z0-9_]*\\b", NULL, TB_GREEN, TB_DEFAULT },

tests/func/test_syntax.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ not_expected[style_sc_not_b]='<ch=98 fg=(0|260)\b'
7575
source 'test.sh'
7676

7777
cat >$tmpf <<"EOD"
78+
# ccc
7879
aaa "bbb" // ccc "ccc"
7980
aaa "bbb" # ccc "ccc"
8081
EOD

0 commit comments

Comments
 (0)