diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-03 17:31:10 -0500 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2021-02-03 17:31:10 -0500 |
commit | b72ce9a3fdfe956f566c8bdde1fceebe7601c59f (patch) | |
tree | 09158b7dff487a4b87b4c17d59e8f875322a91d4 | |
parent | 904dd2a61ef195c19d5a64dd5635b6e4c1364b7e (diff) |
fix syntax highlighting for ' number separator C++
-rw-r--r-- | syntax.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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: |