aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2007-06-12 03:15:00 +0000
committernyamatongwe <unknown>2007-06-12 03:15:00 +0000
commitf0ae7daf36aa9e48b6cccddbee4e60cc9995e9d7 (patch)
tree473a62bd61a4d97c678ff42ea360f86a9b3d1421
parentb66543bf40eeb63a048474fda6ff6a0097e77e3a (diff)
downloadscintilla-mirror-f0ae7daf36aa9e48b6cccddbee4e60cc9995e9d7.tar.gz
Fixed bug where setting the same range twice to the same value resulted
in rest of document being set.
-rw-r--r--src/RunStyles.cxx16
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;
}