aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/RunStyles.cxx
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2007-04-07 00:57:03 +0000
committernyamatongwe <devnull@localhost>2007-04-07 00:57:03 +0000
commit8ad28ca6790189274f7cb8066c125140b995e95a (patch)
tree855af185b33b67caf44e49c655059ff76782ef35 /src/RunStyles.cxx
parent6912617ec0d5909de6ddfe1322836cbffa7392ad (diff)
downloadscintilla-mirror-8ad28ca6790189274f7cb8066c125140b995e95a.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) {