diff options
-rw-r--r-- | src/LexCPP.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index c85664fd5..daf95ea02 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -72,17 +72,20 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo for (; sc.More(); sc.Forward()) { + if (sc.atLineStart && (sc.state == SCE_C_STRING)) { + // Prevent SCE_C_STRINGEOL from leaking back to previous line + sc.SetState(SCE_C_STRING); + } + // Handle line continuation generically. if (sc.ch == '\\') { if (sc.Match("\\\n")) { sc.Forward(); - sc.Forward(); continue; } if (sc.Match("\\\r\n")) { sc.Forward(); sc.Forward(); - sc.Forward(); continue; } } |