aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2001-09-24 13:29:37 +0000
committernyamatongwe <devnull@localhost>2001-09-24 13:29:37 +0000
commitd1b0fa9c5d4e7cd8d48e1d4dc4d38676140193e7 (patch)
treefc015f71cea45575ad277f22127b99d97c57b2c9 /src
parent2748de50c1e4b12f3b4cd224950b350684558b88 (diff)
downloadscintilla-mirror-d1b0fa9c5d4e7cd8d48e1d4dc4d38676140193e7.tar.gz
Patch from Stephan for the SC_MARK_BACKGROUND marker.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx33
-rw-r--r--src/LineMarker.cxx2
2 files changed, 26 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 2171924f0..cbf3a951f 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -990,21 +990,38 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis
// is taken by an individual character - internal leading gives varying results.
Font &ctrlCharsFont = vsDraw.styles[STYLE_CONTROLCHAR].font;
+ // See if something overrides the line background color: Either if caret is on the line
+ // and background color is set for that, or if a marker is defined that forces its background
+ // color onto the line, or if a marker is defined but has no selection margin in which to
+ // display itself. These are checked in order with the earlier taking precedence. When
+ // multiple markers cause background override, the color for the highest numbered one is used.
bool overrideBackground = false;
Colour background = Colour(0, 0, 0);
if (caret.active && vsDraw.showCaretLineBackground && ll.containsCaret) {
overrideBackground = true;
background = vsDraw.caretLineBackground.allocated;
}
- if (vsDraw.maskInLine) {
- int marks = pdoc->GetMark(line) & vsDraw.maskInLine;
- if (marks) {
- overrideBackground = true;
- for (int markBit = 0; (markBit < 32) && marks; markBit++) {
- if (marks & 1) {
- background = vsDraw.markers[markBit].back.allocated;
+ if (!overrideBackground) {
+ int marks = pdoc->GetMark(line);
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if ((marks & 1) && vsDraw.markers[markBit].markType == SC_MARK_BACKGROUND) {
+ background = vsDraw.markers[markBit].back.allocated;
+ overrideBackground = true;
+ }
+ marks >>= 1;
+ }
+ }
+ if (!overrideBackground) {
+ if (vsDraw.maskInLine) {
+ int marks = pdoc->GetMark(line) & vsDraw.maskInLine;
+ if (marks) {
+ overrideBackground = true;
+ for (int markBit = 0; (markBit < 32) && marks; markBit++) {
+ if (marks & 1) {
+ background = vsDraw.markers[markBit].back.allocated;
+ }
+ marks >>= 1;
}
- marks >>= 1;
}
}
}
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx
index a7c5b124f..e4b8b3299 100644
--- a/src/LineMarker.cxx
+++ b/src/LineMarker.cxx
@@ -123,7 +123,7 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac
rcSmall.bottom = rc.bottom - 2;
surface->RectangleDraw(rcSmall, fore.allocated, back.allocated);
- } else if (markType == SC_MARK_EMPTY) {
+ } else if (markType == SC_MARK_EMPTY || markType == SC_MARK_BACKGROUND) {
// An invisible marker so don't draw anything
} else if (markType == SC_MARK_VLINE) {