aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Accessor.cxx
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-03-14 23:37:00 +0000
committernyamatongwe <unknown>2000-03-14 23:37:00 +0000
commitdf2e2081a36a3eb26b2ceb7fc02fdb4352679030 (patch)
treeb1eade44a60e6b177006d5a0e5ae27b5c906a0ac /src/Accessor.cxx
parent8ca254d41623b73994c9a28190d2c3c89181e3f1 (diff)
downloadscintilla-mirror-df2e2081a36a3eb26b2ceb7fc02fdb4352679030.tar.gz
Changed uses of ColourSegment to ColourTo and removed ColourSegment method.
Diffstat (limited to 'src/Accessor.cxx')
-rw-r--r--src/Accessor.cxx28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/Accessor.cxx b/src/Accessor.cxx
index 57b7e4dc4..60c5968c5 100644
--- a/src/Accessor.cxx
+++ b/src/Accessor.cxx
@@ -63,35 +63,31 @@ void StylingContext::StartAt(unsigned int start, char chMask) {
Platform::SendScintilla(id, SCI_STARTSTYLING, start, chMask);
}
-void StylingContext::ColourSegment(unsigned int start, unsigned int end, int chAttr) {
+void StylingContext::StartSegment(unsigned int pos) {
+ startSeg = pos;
+}
+
+void StylingContext::ColourTo(unsigned int pos, int chAttr) {
// Only perform styling if non empty range
- if (end != start - 1) {
- if (end < start) {
- Platform::DebugPrintf("Bad colour positions %d - %d\n", start, end);
+ if (pos != startSeg - 1) {
+ if (pos < startSeg) {
+ Platform::DebugPrintf("Bad colour positions %d - %d\n", startSeg, pos);
}
- if (validLen + (end - start + 1) >= bufferSize)
+ if (validLen + (pos - startSeg + 1) >= bufferSize)
Flush();
- if (validLen + (end - start + 1) >= bufferSize) {
+ if (validLen + (pos - startSeg + 1) >= bufferSize) {
// Too big for buffer so send directly
- Platform::SendScintilla(id, SCI_SETSTYLING, end - start + 1, chAttr);
+ Platform::SendScintilla(id, SCI_SETSTYLING, pos - startSeg + 1, chAttr);
} else {
if (chAttr != chWhile)
chFlags = 0;
chAttr |= chFlags;
- for (unsigned int i = start; i <= end; i++) {
+ for (unsigned int i = startSeg; i <= pos; i++) {
styleBuf[validLen++] = chAttr;
}
}
}
-}
-
-void StylingContext::StartSegment(unsigned int pos) {
- startSeg = pos;
-}
-
-void StylingContext::ColourTo(unsigned int pos, int chAttr) {
- ColourSegment(startSeg, pos, chAttr);
startSeg = pos+1;
}