From d432b53e3057891fb25eef60ae431d385d67a6f1 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 26 Mar 2002 05:56:41 +0000 Subject: Improved handling of multiline strings which use '\' continuations. --- src/LexCPP.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index c85664fd5..daf95ea02 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -72,15 +72,18 @@ 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; -- cgit v1.2.3