aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/EditView.cxx
diff options
context:
space:
mode:
authornkmathew <unknown>2015-09-26 10:12:42 +1000
committernkmathew <unknown>2015-09-26 10:12:42 +1000
commit3491002fbd32adbec743cf5ac4400fc463eab5f3 (patch)
treeba31af9776a66f69843ecfcf178e768aeaf0ae74 /src/EditView.cxx
parentcaf87bd4ad84b0570ea087dc34f32cee986bb43a (diff)
downloadscintilla-mirror-3491002fbd32adbec743cf5ac4400fc463eab5f3.tar.gz
Whitespace may be made visible just in indentation.
Diffstat (limited to 'src/EditView.cxx')
-rw-r--r--src/EditView.cxx16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/EditView.cxx b/src/EditView.cxx
index 072a715f4..23fca07af 100644
--- a/src/EditView.cxx
+++ b/src/EditView.cxx
@@ -1301,8 +1301,7 @@ void EditView::DrawBackground(Surface *surface, const EditModel &model, const Vi
if (ts.representation) {
if (ll->chars[i] == '\t') {
// Tab display
- if (drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation))
textBack = vsDraw.whitespaceColours.back;
} else {
// Blob display
@@ -1316,8 +1315,7 @@ void EditView::DrawBackground(Surface *surface, const EditModel &model, const Vi
(inIndentation && vsDraw.viewIndentationGuides == ivReal)) {
for (int cpos = 0; cpos <= i - ts.start; cpos++) {
if (ll->chars[cpos + ts.start] == ' ') {
- if (drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation)) {
PRectangle rcSpace(
ll->positions[cpos + ts.start] + xStart - static_cast<XYPOSITION>(subLineStart),
rcSegment.top,
@@ -1503,8 +1501,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
if (ll->chars[i] == '\t') {
// Tab display
if (phasesDraw == phasesOne) {
- if (drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways))
+ if (drawWhitespaceBackground && vsDraw.WhiteSpaceVisible(inIndentation))
textBack = vsDraw.whitespaceColours.back;
surface->FillRectangle(rcSegment, textBack);
}
@@ -1520,7 +1517,7 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
}
}
if (vsDraw.viewWhitespace != wsInvisible) {
- if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ if (vsDraw.WhiteSpaceVisible(inIndentation)) {
if (vsDraw.whitespaceColours.fore.isSet)
textFore = vsDraw.whitespaceColours.fore;
surface->PenColour(textFore);
@@ -1568,10 +1565,9 @@ void EditView::DrawForeground(Surface *surface, const EditModel &model, const Vi
if (vsDraw.viewWhitespace != wsInvisible) {
if (vsDraw.whitespaceColours.fore.isSet)
textFore = vsDraw.whitespaceColours.fore;
- if (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways) {
+ if (vsDraw.WhiteSpaceVisible(inIndentation)) {
XYPOSITION xmid = (ll->positions[cpos + ts.start] + ll->positions[cpos + ts.start + 1]) / 2;
- if ((phasesDraw == phasesOne) && drawWhitespaceBackground &&
- (!inIndentation || vsDraw.viewWhitespace == wsVisibleAlways)) {
+ if ((phasesDraw == phasesOne) && drawWhitespaceBackground) {
textBack = vsDraw.whitespaceColours.back;
PRectangle rcSpace(
ll->positions[cpos + ts.start] + xStart - static_cast<XYPOSITION>(subLineStart),