diff options
-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; } |