summaryrefslogtreecommitdiff
path: root/syntax.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-03 17:31:10 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-03 17:31:10 -0500
commitb72ce9a3fdfe956f566c8bdde1fceebe7601c59f (patch)
tree09158b7dff487a4b87b4c17d59e8f875322a91d4 /syntax.c
parent904dd2a61ef195c19d5a64dd5635b6e4c1364b7e (diff)
fix syntax highlighting for ' number separator C++
Diffstat (limited to 'syntax.c')
-rw-r--r--syntax.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/syntax.c b/syntax.c
index 5d83cdb..01e6b7d 100644
--- a/syntax.c
+++ b/syntax.c
@@ -158,7 +158,8 @@ static void syntax_highlight_c_cpp(SyntaxState *state_ptr, bool cpp, char32_t *l
char_types[i] = SYNTAX_CHARACTER;
}
} else if (!in_multi_line_comment && !in_single_line_comment && !in_string) {
- in_char = true;
+ if (i == 0 || !is32_digit(line[i-1])) // in C++, you can use ' as a separator, e.g. 1'000'000
+ in_char = true;
}
break;
case ANY_DIGIT: