summaryrefslogtreecommitdiff
path: root/syntax.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2022-10-28 13:28:18 -0400
committerpommicket <pommicket@gmail.com>2022-10-28 13:28:18 -0400
commitaf6a9c5552d3bd4e708d644cc47e4be4ca2edaf8 (patch)
tree700fa3006babc185018b9ac49cdec90dbce50cb9 /syntax.c
parent67beb21c710509acdb11017a77805ec57676e666 (diff)
fixed rust '\\' highlighting, among other things
Diffstat (limited to 'syntax.c')
-rw-r--r--syntax.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/syntax.c b/syntax.c
index 5b06d2f..d5c79fe 100644
--- a/syntax.c
+++ b/syntax.c
@@ -394,6 +394,10 @@ static void syntax_highlight_rust(SyntaxState *state, char32_t const *line, u32
if (line[char_end] == '\'' && backslashes % 2 == 0) {
break;
}
+ if (line[char_end] == '\\')
+ ++backslashes;
+ else
+ backslashes = 0;
if (line[char_end] < CHAR_MAX
&& line[char_end - 1] != '\\'
&& !strchr("abcdefABCDEF0123456789", (char)line[char_end]))