From af304e058c7a4b243283b6674d492024fbbb8eab Mon Sep 17 00:00:00 2001 From: Neil Date: Sat, 26 Jul 2014 13:42:21 +1000 Subject: Bug [#1622]. Don't crash with ## comments in Mako. From John Ehresman. --- lexers/LexHTML.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3