aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2011-06-21 08:13:20 +1000
committernyamatongwe <devnull@localhost>2011-06-21 08:13:20 +1000
commit663b80f79596ca0c0a579d423223133660a0185c (patch)
treef37444de479a44a6dd462c9a190750f73f0e9628
parentc71df402592a89a2b92d250c02bfe25f3f3baeed (diff)
downloadscintilla-mirror-663b80f79596ca0c0a579d423223133660a0185c.tar.gz
Support mako ## comments. Bug #3318818.
From Stephan R.A. Deibel.
-rw-r--r--lexers/LexHTML.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/lexers/LexHTML.cxx b/lexers/LexHTML.cxx
index 4c50a15a1..de057d345 100644
--- a/lexers/LexHTML.cxx
+++ b/lexers/LexHTML.cxx
@@ -588,6 +588,7 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
int state = stateForPrintState(StateToPrint);
char makoBlockType[200];
makoBlockType[0] = '\0';
+ int makoComment = 0;
char djangoBlockType[2];
djangoBlockType[0] = '\0';
@@ -818,6 +819,18 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
lineStartVisibleChars = 0;
}
+ // handle start of Mako comment line
+ if (isMako && ch == '#' && chNext == '#') {
+ makoComment = 1;
+ }
+
+ // handle end of Mako comment line
+ else if (isMako && makoComment && (ch == '\r' || ch == '\n')) {
+ makoComment = 0;
+ styler.ColourTo(i, SCE_HP_COMMENTLINE);
+ state = SCE_HP_DEFAULT;
+ }
+
// Allow falling through to mako handling code if newline is going to end a block
if (((ch == '\r' && chNext != '\n') || (ch == '\n')) &&
(!isMako || (0 != strcmp(makoBlockType, "%")))) {