mirror of
https://github.com/LukeSmithxyz/st.git
synced 2024-11-22 15:25:58 +01:00
Make cursor follow text color
This commit is contained in:
parent
1911c9274d
commit
b51bcd5553
2 changed files with 7 additions and 7 deletions
|
@ -118,8 +118,6 @@ static const char *colorname[] = {
|
||||||
*/
|
*/
|
||||||
unsigned int defaultfg = 7;
|
unsigned int defaultfg = 7;
|
||||||
unsigned int defaultbg = 0;
|
unsigned int defaultbg = 0;
|
||||||
static unsigned int defaultcs = 256;
|
|
||||||
static unsigned int defaultrcs = 257;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Default shape of cursor
|
* Default shape of cursor
|
||||||
|
|
12
x.c
12
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;
|
g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE;
|
||||||
|
|
||||||
if (selected(cx, cy)) {
|
if (selected(cx, cy)) {
|
||||||
g.bg = defaultrcs;
|
drawcol = dc.col[g.bg];
|
||||||
g.fg = defaultfg;
|
|
||||||
} else {
|
} else {
|
||||||
g.bg = defaultcs;
|
g.mode |= ATTR_REVERSE;
|
||||||
g.fg = defaultbg;
|
|
||||||
|
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)) {
|
if (IS_SET(MODE_REVERSE)) {
|
||||||
drawcol.color.red = ~drawcol.color.red;
|
drawcol.color.red = ~drawcol.color.red;
|
||||||
|
|
Loading…
Reference in a new issue