aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorColomban Wendling <ban@herbesfolles.org>2016-08-03 17:52:40 +0200
committerColomban Wendling <ban@herbesfolles.org>2016-08-03 17:52:40 +0200
commit3c2d939fd99704b33775f7096c49bb6fa734ad4d (patch)
tree6b34c2a380f6c0e416cbfa120217858ece590a2c
parentaacff117f921f6542149cf64c98efecc67e1c5cc (diff)
downloadscintilla-mirror-3c2d939fd99704b33775f7096c49bb6fa734ad4d.tar.gz
Bug [#1849]: LexHTML: Fix resuming at a script start
The lexer can't handle getting out of some states, so make sure never to start in any of them.
-rw-r--r--lexers/LexHTML.cxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
index 4948d00d5..bd14534d4 100644
--- a/lexers/LexHTML.cxx
+++ b/lexers/LexHTML.cxx
@@ -610,6 +610,17 @@ static void ColouriseHyperTextDoc(Sci_PositionU startPos, Sci_Position length, i
}
styler.StartAt(startPos);
+ /* Nothing handles getting out of these, so we need not start in any of them.
+ * As we're at line start and they can't span lines, we'll re-detect them anyway */
+ switch (state) {
+ case SCE_H_QUESTION:
+ case SCE_H_XMLSTART:
+ case SCE_H_XMLEND:
+ case SCE_H_ASP:
+ state = SCE_H_DEFAULT;
+ break;
+ }
+
Sci_Position lineCurrent = styler.GetLine(startPos);
int lineState;
if (lineCurrent > 0) {