diff options
author | nyamatongwe <unknown> | 2000-04-23 22:58:26 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2000-04-23 22:58:26 +0000 |
commit | 1a0760897c81afebc3e9d2ead502d09eff9479ee (patch) | |
tree | d86be196f402ee62edae2b3158d5445da9275fe1 /src/LexPython.cxx | |
parent | 944bf4364d72cef3c55f212628a3414ffcbf961c (diff) | |
download | scintilla-mirror-1a0760897c81afebc3e9d2ead502d09eff9479ee.tar.gz |
Ensured lexers do not style any more than they have been asked to.
Diffstat (limited to 'src/LexPython.cxx')
-rw-r--r-- | src/LexPython.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/LexPython.cxx b/src/LexPython.cxx index 84444bdff..f309036a7 100644 --- a/src/LexPython.cxx +++ b/src/LexPython.cxx @@ -44,8 +44,8 @@ static bool IsPyComment(Accessor &styler, int pos, int len) { static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, WordList *keywordlists[], Accessor &styler) { - int endDoc = startPos + length; - + int lengthDoc = startPos + length; + // Backtrack to previous line in case need to fix its fold status or tab whinging int lineCurrent = styler.GetLine(startPos); if (startPos > 0) { @@ -79,7 +79,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, char chNext = styler[startPos]; styler.StartSegment(startPos); bool atStartLine = true; - for (int i = startPos; i <= endDoc; i++) { + for (int i = startPos; i < lengthDoc; i++) { if (atStartLine) { char chBad = static_cast<char>(64); @@ -102,7 +102,7 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, chNext = styler.SafeGetCharAt(i + 1); char chNext2 = styler.SafeGetCharAt(i + 2); - if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == endDoc)) { + if ((ch == '\r' && chNext != '\n') || (ch == '\n') || (i == lengthDoc)) { if ((state == SCE_P_DEFAULT) || (state == SCE_P_TRIPLE) || (state == SCE_P_TRIPLEDOUBLE)) { // Perform colourisation of white space and triple quoted strings at end of each line to allow // tab marking to work inside white space and triple quoted strings @@ -261,9 +261,9 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle, chPrev = ch; } if (state == SCE_P_WORD) { - ClassifyWordPy(styler.GetStartSegment(), endDoc, keywords, styler, prevWord); + ClassifyWordPy(styler.GetStartSegment(), lengthDoc, keywords, styler, prevWord); } else { - styler.ColourTo(endDoc, state); + styler.ColourTo(lengthDoc, state); } } |