summaryrefslogtreecommitdiffstats
path: root/scintilla/lexers
diff options
context:
space:
mode:
Diffstat (limited to 'scintilla/lexers')
-rw-r--r--scintilla/lexers/LexHTML.cxx31
-rw-r--r--scintilla/lexers/LexPerl.cxx6
2 files changed, 33 insertions, 4 deletions
diff --git a/scintilla/lexers/LexHTML.cxx b/scintilla/lexers/LexHTML.cxx
index a456612..242a37d 100644
--- a/scintilla/lexers/LexHTML.cxx
+++ b/scintilla/lexers/LexHTML.cxx
@@ -955,6 +955,37 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty
continue;
}
+ // handle the start/end of Django comment
+ else if (isDjango && state != SCE_H_COMMENT && (ch == '{' && chNext == '#')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ beforePreProc = state;
+ beforeLanguage = scriptLanguage;
+ if (inScriptType == eNonHtmlScript)
+ inScriptType = eNonHtmlScriptPreProc;
+ else
+ inScriptType = eNonHtmlPreProc;
+ i += 1;
+ visibleChars += 1;
+ scriptLanguage = eScriptComment;
+ state = SCE_H_COMMENT;
+ styler.ColourTo(i, SCE_H_ASP);
+ ch = static_cast<unsigned char>(styler.SafeGetCharAt(i));
+ continue;
+ }
+ else if (isDjango && state == SCE_H_COMMENT && (ch == '#' && chNext == '}')) {
+ styler.ColourTo(i - 1, StateToPrint);
+ i += 1;
+ visibleChars += 1;
+ styler.ColourTo(i, SCE_H_ASP);
+ state = beforePreProc;
+ if (inScriptType == eNonHtmlScriptPreProc)
+ inScriptType = eNonHtmlScript;
+ else
+ inScriptType = eHtml;
+ scriptLanguage = beforeLanguage;
+ continue;
+ }
+
// handle the start Django template code
else if (isDjango && scriptLanguage != eScriptPython && (ch == '{' && (chNext == '%' || chNext == '{'))) {
if (chNext == '%')
diff --git a/scintilla/lexers/LexPerl.cxx b/scintilla/lexers/LexPerl.cxx
index e345a9b..6c9b427 100644
--- a/scintilla/lexers/LexPerl.cxx
+++ b/scintilla/lexers/LexPerl.cxx
@@ -1357,10 +1357,8 @@ void SCI_METHOD LexerPerl::Fold(unsigned int startPos, int length, int /* initSt
// Backtrack to previous line in case need to fix its fold status
if (startPos > 0) {
if (lineCurrent > 0) {
- if (IsCommentLine(lineCurrent - 1, styler)) {
- lineCurrent--;
- startPos = styler.LineStart(lineCurrent);
- }
+ lineCurrent--;
+ startPos = styler.LineStart(lineCurrent);
}
}