diff options
| -rw-r--r-- | x.c | 17 |
1 files changed, 13 insertions, 4 deletions
| @@ -1404,6 +1404,7 @@ void | |||
| 1404 | xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) | 1404 | xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) |
| 1405 | { | 1405 | { |
| 1406 | Color drawcol; | 1406 | Color drawcol; |
| 1407 | uint32_t cc; | ||
| 1407 | 1408 | ||
| 1408 | /* remove the old cursor */ | 1409 | /* remove the old cursor */ |
| 1409 | if (selected(ox, oy)) | 1410 | if (selected(ox, oy)) |
| @@ -1419,14 +1420,22 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) | |||
| 1419 | g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; | 1420 | g.mode &= ATTR_BOLD|ATTR_ITALIC|ATTR_UNDERLINE|ATTR_STRUCK|ATTR_WIDE; |
| 1420 | 1421 | ||
| 1421 | if (selected(cx, cy)) { | 1422 | if (selected(cx, cy)) { |
| 1422 | drawcol = dc.col[g.bg]; | 1423 | cc = g.bg; |
| 1423 | } else { | 1424 | } else { |
| 1424 | g.mode |= ATTR_REVERSE; | 1425 | g.mode |= ATTR_REVERSE; |
| 1425 | |||
| 1426 | if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7)) | 1426 | if (g.mode & ATTR_BOLD && BETWEEN(g.fg, 0, 7)) |
| 1427 | drawcol = dc.col[g.fg + 8]; | 1427 | cc = g.fg + 8; |
| 1428 | else | 1428 | else |
| 1429 | drawcol = dc.col[g.fg]; | 1429 | cc = g.fg; |
| 1430 | } | ||
| 1431 | |||
| 1432 | if (IS_TRUECOL(cc)) { | ||
| 1433 | drawcol.color.alpha = 0xffff; | ||
| 1434 | drawcol.color.red = TRUERED(cc); | ||
| 1435 | drawcol.color.green = TRUEGREEN(cc); | ||
| 1436 | drawcol.color.blue = TRUEBLUE(cc); | ||
| 1437 | } else { | ||
| 1438 | drawcol = dc.col[cc]; | ||
| 1430 | } | 1439 | } |
| 1431 | 1440 | ||
| 1432 | if (IS_SET(MODE_REVERSE)) { | 1441 | if (IS_SET(MODE_REVERSE)) { |
