aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexLua.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2002-06-08 05:22:55 +0000
committernyamatongwe <unknown>2002-06-08 05:22:55 +0000
commit2c5b647c3ccfa9a6ba413687006ed46744e8a921 (patch)
tree0d7654cc792a9996dc27003f6ccb525c90bbf568 /src/LexLua.cxx
parentad564f464b2fbaf69c987e5e60fc66ac53715ae1 (diff)
downloadscintilla-mirror-2c5b647c3ccfa9a6ba413687006ed46744e8a921.tar.gz
Patch from Philippe to fix multiline string handling.
Diffstat (limited to 'src/LexLua.cxx')
-rw-r--r--src/LexLua.cxx22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/LexLua.cxx b/src/LexLua.cxx
index 23a999fa9..fc9607e25 100644
--- a/src/LexLua.cxx
+++ b/src/LexLua.cxx
@@ -81,17 +81,19 @@ static void ColouriseLuaDoc(
sc.SetState(SCE_LUA_COMMENTLINE);
}
for (; sc.More(); sc.Forward()) {
- // 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();
+ if (sc.atLineStart && (sc.state == SCE_LUA_STRING)) {
+ // Prevent SCE_LUA_STRINGEOL from leaking back to previous line
+ sc.SetState(SCE_LUA_STRING);
+ }
+
+ // Handle string line continuation
+ if ((sc.state == SCE_LUA_STRING || sc.state == SCE_LUA_CHARACTER) &&
+ sc.ch == '\\') {
+ if (sc.chNext == '\n' || sc.chNext == '\r') {
sc.Forward();
+ if (sc.ch == '\r' && sc.chNext == '\n') {
+ sc.Forward();
+ }
continue;
}
}