diff options
author | nyamatongwe <unknown> | 2007-04-07 00:57:03 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2007-04-07 00:57:03 +0000 |
commit | 6d82fda3c167c1ebdc7242f9ee6d42de2a47e838 (patch) | |
tree | 855af185b33b67caf44e49c655059ff76782ef35 /src/RunStyles.cxx | |
parent | cfc2acb4089acc872b9f06031ca39eef637c149c (diff) | |
download | scintilla-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.cxx | 13 |
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) { |