diff options
author | Neil <nyamatongwe@gmail.com> | 2014-07-26 13:42:21 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2014-07-26 13:42:21 +1000 |
commit | 033a05261be492ffc78da8c1eda92188a54c3fa7 (patch) | |
tree | cb6b6c04dab0d0fb7fed3716f71e8bfaac50fcbc | |
parent | 36404e38961745272fcd2137ec6b778df3940137 (diff) | |
download | scintilla-mirror-033a05261be492ffc78da8c1eda92188a54c3fa7.tar.gz |
Bug [#1622]. Don't crash with ## comments in Mako.
From John Ehresman.
-rw-r--r-- | lexers/LexHTML.cxx | 8 |
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 |