Fix #118767: Incorrect Python syntax highlighting for mult-line strings

Lines beginning with a back-slash used a previous character that
was initialized to the default which isn't correct for multi-line
strings.
This commit is contained in:
Campbell Barton
2024-02-27 21:24:37 +11:00
parent 0d9cd1ee2d
commit efdbdd6915

View File

@@ -346,6 +346,10 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const bool do_n
fmt = line->prev->format;
cont = fmt[strlen(fmt) + 1]; /* Just after the null-terminator */
BLI_assert((FMT_CONT_ALL & cont) == cont);
/* So slashes beginning on continuation display properly, see: #118767. */
if (cont & (FMT_CONT_QUOTEDOUBLE | FMT_CONT_QUOTESINGLE | FMT_CONT_TRIPLE)) {
prev = FMT_TYPE_STRING;
}
}
else {
cont = FMT_CONT_NOP;