From efdbdd6915b2770331e553eec636031c11eade9b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 27 Feb 2024 21:24:37 +1100 Subject: [PATCH] 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. --- source/blender/editors/space_text/text_format_py.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/blender/editors/space_text/text_format_py.cc b/source/blender/editors/space_text/text_format_py.cc index 7c997e57cfe..7e401253e2e 100644 --- a/source/blender/editors/space_text/text_format_py.cc +++ b/source/blender/editors/space_text/text_format_py.cc @@ -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;