aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2014-07-26 13:42:21 +1000
committerNeil <nyamatongwe@gmail.com>2014-07-26 13:42:21 +1000
commit033a05261be492ffc78da8c1eda92188a54c3fa7 (patch)
treecb6b6c04dab0d0fb7fed3716f71e8bfaac50fcbc
parent36404e38961745272fcd2137ec6b778df3940137 (diff)
downloadscintilla-mirror-033a05261be492ffc78da8c1eda92188a54c3fa7.tar.gz
Bug [#1622]. Don't crash with ## comments in Mako.
From John Ehresman.
-rw-r--r--lexers/LexHTML.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
index 4bc4b765b..77a4cc582 100644
--- a/lexers/LexHTML.cxx
+++ b/lexers/LexHTML.cxx
@@ -822,12 +822,18 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
// handle start of Mako comment line
if (isMako && ch == '#' && chNext == '#') {
makoComment = 1;
+ state = SCE_HP_COMMENTLINE;
}
// handle end of Mako comment line
else if (isMako && makoComment && (ch == '\r' || ch == '\n')) {
makoComment = 0;
- styler.ColourTo(i, SCE_HP_COMMENTLINE);
+ styler.ColourTo(i, StateToPrint);
+ if (inScriptType == eScriptPython) {
+ state = SCE_HP_DEFAULT;
+ } else {
+ state = SCE_H_DEFAULT;
+ }
}
// Allow falling through to mako handling code if newline is going to end a block