diff options
-rw-r--r-- | src/LexHTML.cxx | 12 | ||||
-rw-r--r-- | src/LexPython.cxx | 9 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index f7cd0e286..be1da389c 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -560,15 +560,13 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty inScriptType = eNonHtmlPreProc; if (chNext2 == '@') { - char chNext3 = styler.SafeGetCharAt(i + 3); - if (chNext3 == '@') { - styler.ColourTo(i + 3, SCE_H_ASP); - state = SCE_H_XCCOMMENT; - scriptLanguage = eScriptVBS; - continue; - } i += 2; // place as if it was the second next char treated state = SCE_H_ASPAT; + } else if ((chNext2 == '-') && (styler.SafeGetCharAt(i + 3) == '-')) { + styler.ColourTo(i + 3, SCE_H_ASP); + state = SCE_H_XCCOMMENT; + scriptLanguage = eScriptVBS; + continue; } else { if (chNext2 == '=') { i += 2; // place as if it was the second next char treated diff --git a/src/LexPython.cxx b/src/LexPython.cxx index d210e8a04..50ef6a84b 100644 --- a/src/LexPython.cxx +++ b/src/LexPython.cxx @@ -145,8 +145,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, int lengthDoc = startPos + length; // Backtrack to previous line in case need to fix its tab whinging + int lineCurrent = styler.GetLine(startPos); if (startPos > 0) { - int lineCurrent = styler.GetLine(startPos); if (lineCurrent > 0) { startPos = styler.LineStart(lineCurrent-1); if (startPos == 0) @@ -176,6 +176,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, styler.StartSegment(startPos); bool atStartLine = true; int spaceFlags = 0; + styler.IndentAmount(lineCurrent, &spaceFlags, IsPyComment); for (int i = startPos; i < lengthDoc; i++) { if (atStartLine) { @@ -205,6 +206,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, // tab marking to work inside white space and triple quoted strings styler.ColourTo(i, state); } + lineCurrent++; + styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsPyComment); atStartLine = true; } @@ -342,10 +345,10 @@ static void FoldPyDoc(unsigned int startPos, int length, int initStyle, for (int i = startPos; i < lengthDoc; i++) { char ch = chNext; chNext = styler.SafeGetCharAt(i + 1); - int style = styler.StyleAt(i) & 31; if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) { int lev = indentCurrent; + int style = styler.StyleAt(i) & 31; int indentNext = styler.IndentAmount(lineCurrent + 1, &spaceFlags, IsPyComment); if ((style == SCE_P_TRIPLE) || (style== SCE_P_TRIPLEDOUBLE)) indentNext |= SC_FOLDLEVELWHITEFLAG; @@ -368,5 +371,5 @@ static void FoldPyDoc(unsigned int startPos, int length, int initStyle, } } } - + LexerModule lmPython(SCLEX_PYTHON, ColourisePyDoc, "python", FoldPyDoc); |