From b3fca3a85d71d994ebadd577ea58a5355ae37f81 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 21 Apr 2012 21:02:30 +1000 Subject: Fix problem where PHP sequence stops backtracking to tag start. Bug #3520027. Now backtracks by whole lines until not inside tag. --- lexers/LexHTML.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lexers') 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; } -- cgit v1.2.3