aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RunStyles.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2007-04-07 00:57:03 +0000
committernyamatongwe <unknown>2007-04-07 00:57:03 +0000
commit6d82fda3c167c1ebdc7242f9ee6d42de2a47e838 (patch)
tree855af185b33b67caf44e49c655059ff76782ef35 /src/RunStyles.cxx
parentcfc2acb4089acc872b9f06031ca39eef637c149c (diff)
downloadscintilla-mirror-6d82fda3c167c1ebdc7242f9ee6d42de2a47e838.tar.gz
More decoration code, with modifications reported from document to views
although this isn't optimal. Some checking for null changes. Messages documented. Methods for changing indicators in Accessor so can be used by lexers.
Diffstat (limited to 'src/RunStyles.cxx')
-rw-r--r--src/RunStyles.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/RunStyles.cxx b/src/RunStyles.cxx
index a7cf40e81..9a644b1b4 100644
--- a/src/RunStyles.cxx
+++ b/src/RunStyles.cxx
@@ -106,11 +106,17 @@ int RunStyles::EndRun(int position) {
return starts->PositionFromPartition(starts->PartitionFromPosition(position) + 1);
}
-void RunStyles::FillRange(int position, int value, int fillLength) {
+bool RunStyles::FillRange(int position, int value, int fillLength) {
int end = position + fillLength;
- SplitRun(end);
int runStart = RunFromPosition(position);
- if (styles->ValueAt(runStart) != value) {
+ if (styles->ValueAt(runStart) == value) {
+ if (end <= starts->PositionFromPartition(runStart + 1)) {
+ // Whole range is already same as value
+ return false;
+ }
+ SplitRun(end);
+ } else {
+ SplitRun(end);
SplitRun(position);
runStart = RunFromPosition(position);
styles->SetValueAt(runStart, value);
@@ -123,6 +129,7 @@ void RunStyles::FillRange(int position, int value, int fillLength) {
runEnd = RunFromPosition(end);
RemoveRunIfSameAsPrevious(runEnd);
RemoveRunIfSameAsPrevious(runStart);
+ return true;
}
void RunStyles::InsertSpace(int position, int insertLength) {