diff options
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);  	}  } | 
