aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/LexPython.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-04-23 22:58:26 +0000
committernyamatongwe <devnull@localhost>2000-04-23 22:58:26 +0000
commit7755da7142f88f1d9695fea500f9ae3f86d202ba (patch)
treed86be196f402ee62edae2b3158d5445da9275fe1 /src/LexPython.cxx
parent6956977bdf58be27805d82c1aa33fc9d4c384241 (diff)
downloadscintilla-mirror-7755da7142f88f1d9695fea500f9ae3f86d202ba.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.cxx12
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);
}
}