diff options
author | nyamatongwe <unknown> | 2008-07-19 10:54:30 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2008-07-19 10:54:30 +0000 |
commit | 4199c9464f87c4569901880fd84125891db54d1a (patch) | |
tree | d990984899063ac34879b0156f5e8ac03d39826a | |
parent | 6afdfc1da5ec550c9b8bd5351698121c3647159d (diff) | |
download | scintilla-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.
-rw-r--r-- | src/LexHTML.cxx | 14 |
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)); |