aboutsummaryrefslogtreecommitdiff
path: root/x.c
diff options
context:
space:
mode:
authorJules Maselbas <jules.maselbas@grenoble-inp.org>2018-07-14 11:16:37 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2018-07-14 12:49:37 +0200
commitb51bcd5553af3db394014efbd78acf7828fa48ff (patch)
treefb7582a0413fec0816cda3b7375235aa372bcb0c /x.c
parent1911c9274d9b03f3d7999c6ce26e2d5169642d26 (diff)
downloadst-b51bcd5553af3db394014efbd78acf7828fa48ff.tar.gz
st-b51bcd5553af3db394014efbd78acf7828fa48ff.tar.bz2
Make cursor follow text color
Diffstat (limited to 'x.c')
-rw-r--r--x.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/x.c b/x.c
index ffd005f..b51821d 100644
--- a/x.c
+++ b/x.c
@@ -1419,13 +1419,15 @@ 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 (selected(cx, cy)) {
- g.bg = defaultrcs;
- g.fg = defaultfg;
+ drawcol = dc.col[g.bg];
} else {
- g.bg = defaultcs;
- g.fg = defaultbg;
+ g.mode |= ATTR_REVERSE;
+
+ if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7))
+ drawcol = dc.col[g.fg + 8];
+ else
+ drawcol = dc.col[g.fg];
}
- drawcol = dc.col[g.bg];
if (IS_SET(MODE_REVERSE)) {
drawcol.color.red = ~drawcol.color.red;