From b39e98f7e8a340bb5777029b05fc84b2b5ba6c08 Mon Sep 17 00:00:00 2001 From: pommicket Date: Thu, 6 Jul 2023 18:00:14 -0400 Subject: TODO highlighting in single-line comments, more js keywords --- syntax.c | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) (limited to 'syntax.c') diff --git a/syntax.c b/syntax.c index 1a5e1cf..308f39e 100644 --- a/syntax.c +++ b/syntax.c @@ -523,7 +523,7 @@ static void syntax_highlight_rust(SyntaxState *state, const char32_t *line, u32 // just handle it all now if (char_types) { for (u32 j = i; j < line_len; ++j) - char_types[j] = SYNTAX_COMMENT; + char_types[j] = syntax_highlight_comment(line, j, line_len); } i = line_len - 1; dealt_with = true; @@ -731,7 +731,7 @@ static void syntax_highlight_python(SyntaxState *state, const char32_t *line, u3 // comment if (char_types) { for (u32 j = i; j < line_len; ++j) - char_types[j] = SYNTAX_COMMENT; + char_types[j] = syntax_highlight_comment(line, j, line_len); dealt_with = true; } i = line_len - 1; @@ -895,7 +895,7 @@ static void syntax_highlight_tex(SyntaxState *state, const char32_t *line, u32 l if (!verbatim) { for (; i < line_len; ++i) { if (char_types) - char_types[i] = SYNTAX_COMMENT; + char_types[i] = syntax_highlight_comment(line, i, line_len); } } break; @@ -1150,7 +1150,7 @@ static void syntax_highlight_html_like(SyntaxState *state, const char32_t *line, // (don't worry, comments can't nest in HTML) comment = false; } else { - if (char_types) char_types[i] = SYNTAX_COMMENT; + if (char_types) char_types[i] = syntax_highlight_comment(line, i, line_len); } } else if (!in_sgl_string && !in_dbl_string && str32_has_ascii_prefix(remains, "