Skip to content

Commit

Permalink
highlight # ... as comment at beginning of line in syn_generic
Browse files Browse the repository at this point in the history
  • Loading branch information
adsr committed Dec 1, 2024
1 parent 6ff6caf commit f5a00a4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion editor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
{ "(?<!\\w)[\\%@$][a-zA-Z_$][a-zA-Z0-9_]*\\b", NULL, TB_GREEN, TB_DEFAULT },
Expand Down
1 change: 1 addition & 0 deletions tests/func/test_syntax.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ not_expected[style_sc_not_b]='<ch=98 fg=(0|260)\b'
source 'test.sh'

cat >$tmpf <<"EOD"
# ccc
aaa "bbb" // ccc "ccc"
aaa "bbb" # ccc "ccc"
EOD
Expand Down

0 comments on commit f5a00a4

Please sign in to comment.