diff options
| author | nyamatongwe <unknown> | 2007-06-12 03:15:00 +0000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2007-06-12 03:15:00 +0000 | 
| commit | f0ae7daf36aa9e48b6cccddbee4e60cc9995e9d7 (patch) | |
| tree | 473a62bd61a4d97c678ff42ea360f86a9b3d1421 /src/RunStyles.cxx | |
| parent | b66543bf40eeb63a048474fda6ff6a0097e77e3a (diff) | |
| download | scintilla-mirror-f0ae7daf36aa9e48b6cccddbee4e60cc9995e9d7.tar.gz | |
Fixed bug where setting the same range twice to the same value resulted
in rest of document being set.
Diffstat (limited to 'src/RunStyles.cxx')
| -rw-r--r-- | src/RunStyles.cxx | 16 | 
1 files changed, 9 insertions, 7 deletions
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx index 76174fea4..13d48244b 100644 --- a/src/RunStyles.cxx +++ b/src/RunStyles.cxx @@ -138,14 +138,16 @@ bool RunStyles::FillRange(int &position, int value, int &fillLength) {  			runEnd++;  		}  	} -	styles->SetValueAt(runStart, value); -	// Remove each old run over the range -	for (int run=runStart+1; run<runEnd; run++) { -		RemoveRun(runStart+1); +	if (runStart < runEnd) { +		styles->SetValueAt(runStart, value); +		// Remove each old run over the range +		for (int run=runStart+1; run<runEnd; run++) { +			RemoveRun(runStart+1); +		} +		runEnd = RunFromPosition(end); +		RemoveRunIfSameAsPrevious(runEnd); +		RemoveRunIfSameAsPrevious(runStart);  	} -	runEnd = RunFromPosition(end); -	RemoveRunIfSameAsPrevious(runEnd); -	RemoveRunIfSameAsPrevious(runStart);  	return true;  }  | 
