diff options
| author | nyamatongwe <devnull@localhost> | 2005-09-10 00:40:26 +0000 | 
|---|---|---|
| committer | nyamatongwe <devnull@localhost> | 2005-09-10 00:40:26 +0000 | 
| commit | 1675b97fd29dc03a94d23019b2aaa18f22e01056 (patch) | |
| tree | ad2001d7fff870d89f5218303916b2a15226b6ff /src | |
| parent | bb242255b57e983cdf46d005f1833302d4fd2f52 (diff) | |
| download | scintilla-mirror-1675b97fd29dc03a94d23019b2aaa18f22e01056.tar.gz | |
Reduced range of styling modification notification so that out of region
painting is less likely, so painting will complete without triggering a
full repaint. This was a problem with some lexers that backtracked to see
if the line before a modification needed restyling.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Document.cxx | 11 | 
1 files changed, 7 insertions, 4 deletions
| diff --git a/src/Document.cxx b/src/Document.cxx index 8e78f5b46..27260d6d4 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -1309,19 +1309,22 @@ bool Document::SetStyles(int length, char *styles) {  		return false;  	} else {  		enteredCount++; -		int prevEndStyled = endStyled;  		bool didChange = false; -		int lastChange = 0; +		int startMod = 0; +		int endMod = 0;  		for (int iPos = 0; iPos < length; iPos++, endStyled++) {  			PLATFORM_ASSERT(endStyled < Length());  			if (cb.SetStyleAt(endStyled, styles[iPos], stylingMask)) { +				if (!didChange) { +					startMod = endStyled; +				}  				didChange = true; -				lastChange = iPos; +				endMod = endStyled;  			}  		}  		if (didChange) {  			DocModification mh(SC_MOD_CHANGESTYLE | SC_PERFORMED_USER, -			                   prevEndStyled, lastChange); +			                   startMod, endMod - startMod + 1);  			NotifyModified(mh);  		}  		enteredCount--; | 
