diff options
author | nyamatongwe <devnull@localhost> | 2012-04-21 21:02:30 +1000 |
---|---|---|
committer | nyamatongwe <devnull@localhost> | 2012-04-21 21:02:30 +1000 |
commit | b3fca3a85d71d994ebadd577ea58a5355ae37f81 (patch) | |
tree | a79146eaa43a44f1f4d2e3256423f3e53e4f82da | |
parent | 8a58b6cf60425264c7e052c55e00a28b42830eb4 (diff) | |
download | scintilla-mirror-b3fca3a85d71d994ebadd577ea58a5355ae37f81.tar.gz |
Fix problem where PHP sequence stops backtracking to tag start. Bug #3520027.
Now backtracks by whole lines until not inside tag.
-rw-r--r-- | lexers/LexHTML.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx index 9ebca16f8..7534acc8e 100644 --- a/lexers/LexHTML.cxx +++ b/lexers/LexHTML.cxx @@ -598,11 +598,12 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty char djangoBlockType[2]; djangoBlockType[0] = '\0'; - // If inside a tag, it may be a script tag, so reread from the start to ensure any language tags are seen + // If inside a tag, it may be a script tag, so reread from the start of line starting tag to ensure any language tags are seen if (InTagState(state)) { while ((startPos > 0) && (InTagState(styler.StyleAt(startPos - 1)))) { - startPos--; - length++; + int backLineStart = styler.LineStart(styler.GetLine(startPos-1)); + length += startPos - backLineStart; + startPos = backLineStart; } state = SCE_H_DEFAULT; } |