summaryrefslogtreecommitdiffstats
path: root/scintilla/lexers/LexHTML.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'scintilla/lexers/LexHTML.cxx')
-rw-r--r--scintilla/lexers/LexHTML.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index abfa98f..7bda6cf 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/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;
}
@@ -1584,6 +1585,10 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
state = SCE_HJ_COMMENTDOC;
else
state = SCE_HJ_COMMENT;
+ if (chNext2 == '/') {
+ // Eat the * so it isn't used for the end of the comment
+ i++;
+ }
} else if (ch == '/' && chNext == '/') {
styler.ColourTo(i - 1, StateToPrint);
state = SCE_HJ_COMMENTLINE;