aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexers/LexHTML.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2011-06-21 08:13:20 +1000
committernyamatongwe <unknown>2011-06-21 08:13:20 +1000
commit348bce2c59fd0da8d19e9e6e65fb846ea5e54948 (patch)
treee4f16f0bae321b9b6c7b7ff2976140c1679fc360 /lexers/LexHTML.cxx
parent475492ef416ff310d14a94a600aa97e7d4f6e7fb (diff)
downloadscintilla-mirror-348bce2c59fd0da8d19e9e6e65fb846ea5e54948.tar.gz
Support mako ## comments. Bug #3318818.
From Stephan R.A. Deibel.
Diffstat (limited to 'lexers/LexHTML.cxx')
-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, "%")))) {