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 | af304e058c7a4b243283b6674d492024fbbb8eab (patch) | |
tree | 53d531acd3a58b86718458a1bf7683bf8915d6e4 | |
parent | cc3f43d62336b1d0ec1bafd67e753aceab807e51 (diff) | |
download | scintilla-mirror-af304e058c7a4b243283b6674d492024fbbb8eab.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 |