aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RunStyles.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2007-06-09 01:07:26 +0000
committernyamatongwe <unknown>2007-06-09 01:07:26 +0000
commite59baa81ae3b048af0a85056e0827abed2051e66 (patch)
treeb9e32fd0443391c2f9cb564e80de5744031c7363 /src/RunStyles.cxx
parent8ec2442ab4a0a8d568b970281aded681634f1cf1 (diff)
downloadscintilla-mirror-e59baa81ae3b048af0a85056e0827abed2051e66.tar.gz
Fixed bug when setting a range where the start of the range was already a
run start.
Diffstat (limited to 'src/RunStyles.cxx')
-rw-r--r--src/RunStyles.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx
index 286734e9b..76174fea4 100644
--- a/src/RunStyles.cxx
+++ b/src/RunStyles.cxx
@@ -130,11 +130,13 @@ bool RunStyles::FillRange(int &position, int value, int &fillLength) {
if (styles->ValueAt(runStart) == value) {
// Start is in expected value so trim range.
runStart++;
- position = starts->PositionFromPartition(runStart);
+ position = starts->PositionFromPartition(runStart);
fillLength = end - position;
} else {
- runStart = SplitRun(position);
- runEnd++;
+ if (starts->PositionFromPartition(runStart) < position) {
+ runStart = SplitRun(position);
+ runEnd++;
+ }
}
styles->SetValueAt(runStart, value);
// Remove each old run over the range