aboutsummarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJules Maselbas2018-07-14 11:16:36 +0200
committerHiltjo Posthuma2018-07-14 12:49:35 +0200
commitf6917aa5f0e4e55615fd8a11f216a5093bc0708e (patch)
treef05c6f6fa461745020dd5933ab855b5210c6f8e8
parent75cb367348c0559cbb54b715e844f023b10eb3c8 (diff)
downloadaur-f6917aa5f0e4e55615fd8a11f216a5093bc0708e.tar.gz
Simplify cursor color handling
-rw-r--r--x.c30
1 files changed, 12 insertions, 18 deletions
diff --git a/x.c b/x.c
index 00cb6b18658a..ffd005fae152 100644
--- a/x.c
+++ b/x.c
@@ -1418,25 +1418,19 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og)
*/
g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
- if (IS_SET(MODE_REVERSE)) {
- g.mode |= ATTR_REVERSE;
- g.bg = defaultfg;
- if (selected(cx, cy)) {
- drawcol = dc.col[defaultcs];
- g.fg = defaultrcs;
- } else {
- drawcol = dc.col[defaultrcs];
- g.fg = defaultcs;
- }
+ if (selected(cx, cy)) {
+ g.bg = defaultrcs;
+ g.fg = defaultfg;
} else {
- if (selected(cx, cy)) {
- g.fg = defaultfg;
- g.bg = defaultrcs;
- } else {
- g.fg = defaultbg;
- g.bg = defaultcs;
- }
- drawcol = dc.col[g.bg];
+ g.bg = defaultcs;
+ g.fg = defaultbg;
+ }
+ drawcol = dc.col[g.bg];
+
+ if (IS_SET(MODE_REVERSE)) {
+ drawcol.color.red = ~drawcol.color.red;
+ drawcol.color.green = ~drawcol.color.green;
+ drawcol.color.blue = ~drawcol.color.blue;
}
/* draw the new one */