aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexHTML.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2008-07-19 10:54:30 +0000
committernyamatongwe <unknown>2008-07-19 10:54:30 +0000
commit4199c9464f87c4569901880fd84125891db54d1a (patch)
treed990984899063ac34879b0156f5e8ac03d39826a /src/LexHTML.cxx
parent6afdfc1da5ec550c9b8bd5351698121c3647159d (diff)
downloadscintilla-mirror-4199c9464f87c4569901880fd84125891db54d1a.tar.gz
Bug #2016218 from Jason Oster fixes problems caused by not
backtracking far enough when start of lexing is within a PHP string.
Diffstat (limited to 'src/LexHTML.cxx')
-rw-r--r--src/LexHTML.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx
index f63923d07..c0a47d9ed 100644
--- a/src/LexHTML.cxx
+++ b/src/LexHTML.cxx
@@ -542,11 +542,15 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
}
state = SCE_H_DEFAULT;
}
- // String can be heredoc, must find a delimiter first
- while (startPos > 0 && isPHPStringState(state)) {
- startPos--;
- length++;
- state = styler.StyleAt(startPos);
+ // String can be heredoc, must find a delimiter first. Reread from beginning of line containing the string, to get the correct lineState
+ if (isPHPStringState(state)) {
+ while (startPos > 0 && (isPHPStringState(state) || !isLineEnd(styler[startPos - 1]))) {
+ startPos--;
+ length++;
+ state = styler.StyleAt(startPos);
+ }
+ if (startPos == 0)
+ state = SCE_H_DEFAULT;
}
styler.StartAt(startPos, static_cast<char>(STYLE_MAX));