aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2018-07-17 20:01:58 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-07-17 20:01:58 +0200
commit4f4bccd1627c845330235721f593d2e93418723d (patch)
tree920410155c668968d28c1a6a62953c827ff27bb8 /x.c
parent8ed7a4b3b755407a7724a586ef224051bc306f4f (diff)
downloadst-patched-4f4bccd1627c845330235721f593d2e93418723d.tar.bz2
st-patched-4f4bccd1627c845330235721f593d2e93418723d.tar.xz
st-patched-4f4bccd1627c845330235721f593d2e93418723d.zip
Revert "Simplify cursor color handling"
This reverts commit 1911c9274d9b03f3d7999c6ce26e2d5169642d26.
Diffstat (limited to 'x.c')
-rw-r--r--x.c30
1 files changed, 18 insertions, 12 deletions
diff --git a/x.c b/x.c
index ffd005f..00cb6b1 100644
--- a/x.c
+++ b/x.c
@@ -1418,19 +1418,25 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
1418 */ 1418 */
1419 g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; 1419 g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
1420 1420
1421 if (selected(cx, cy)) {
1422 g.bg = defaultrcs;
1423 g.fg = defaultfg;
1424 } else {
1425 g.bg = defaultcs;
1426 g.fg = defaultbg;
1427 }
1428 drawcol = dc.col[g.bg];
1429
1430 if (IS_SET(MODE_REVERSE)) { 1421 if (IS_SET(MODE_REVERSE)) {
1431 drawcol.color.red = ~drawcol.color.red; 1422 g.mode |= ATTR_REVERSE;
1432 drawcol.color.green = ~drawcol.color.green; 1423 g.bg = defaultfg;
1433 drawcol.color.blue = ~drawcol.color.blue; 1424 if (selected(cx, cy)) {
1425 drawcol = dc.col[defaultcs];
1426 g.fg = defaultrcs;
1427 } else {
1428 drawcol = dc.col[defaultrcs];
1429 g.fg = defaultcs;
1430 }
1431 } else {
1432 if (selected(cx, cy)) {
1433 g.fg = defaultfg;
1434 g.bg = defaultrcs;
1435 } else {
1436 g.fg = defaultbg;
1437 g.bg = defaultcs;
1438 }
1439 drawcol = dc.col[g.bg];
1434 } 1440 }
1435 1441
1436 /* draw the new one */ 1442 /* draw the new one */