aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexPython.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-07-25 11:18:27 +0000
committernyamatongwe <devnull@localhost>2001-07-25 11:18:27 +0000
commit4a69987c76efcaff51e24fca23488dda38700cbc (patch)
treede9d7f514c43b40d9c5c538ab6ebd429394b12df /src/LexPython.cxx
parent908229ef41e2222b08fe49f7c0d4deee45f316e9 (diff)
downloadscintilla-mirror-4a69987c76efcaff51e24fca23488dda38700cbc.tar.gz
Make Tab Timmy work again.
Diffstat (limited to 'src/LexPython.cxx')
-rw-r--r--src/LexPython.cxx9
1 files changed, 6 insertions, 3 deletions
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);