From 6fa106f43b3869b757d8d92dbdb750011609474a Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 5 Feb 2010 08:28:58 +0000 Subject: Support for not terminating strings at line end to support Ren'Py langauge with Python lexer. Feature Request #2945550. --- src/LexPython.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/LexPython.cxx') diff --git a/src/LexPython.cxx b/src/LexPython.cxx index 7d31fd251..897a136e9 100644 --- a/src/LexPython.cxx +++ b/src/LexPython.cxx @@ -158,6 +158,10 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, if (styler.GetPropertyInt("lexer.python.strings.b", 1)) allowedLiterals = static_cast(allowedLiterals | litB); + // property lexer.python.strings.over.newline + // Set to 1 to allow strings to span newline characters. + bool stringsOverNewline = styler.GetPropertyInt("lexer.python.strings.over.newline") != 0; + initStyle = initStyle & 31; if (initStyle == SCE_P_STRINGEOL) { initStyle = SCE_P_DEFAULT; @@ -204,7 +208,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, } lineCurrent++; if ((sc.state == SCE_P_STRING) || (sc.state == SCE_P_CHARACTER)) { - if (inContinuedString) { + if (inContinuedString || stringsOverNewline) { inContinuedString = false; } else { sc.ChangeState(SCE_P_STRINGEOL); -- cgit v1.2.3