aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexPython.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2010-02-05 08:28:58 +0000
committernyamatongwe <unknown>2010-02-05 08:28:58 +0000
commit6fa106f43b3869b757d8d92dbdb750011609474a (patch)
tree4d546b7b78b18874e22a24f65123ff48b61b2bbc /src/LexPython.cxx
parentdd16f0a3dab36fc7e10b6acd74ecd7185a791ece (diff)
downloadscintilla-mirror-6fa106f43b3869b757d8d92dbdb750011609474a.tar.gz
Support for not terminating strings at line end to support Ren'Py langauge
with Python lexer. Feature Request #2945550.
Diffstat (limited to 'src/LexPython.cxx')
-rw-r--r--src/LexPython.cxx6
1 files changed, 5 insertions, 1 deletions
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<literalsAllowed>(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);