diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-07-17 20:01:54 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2018-07-17 20:01:54 +0200 |
commit | 732be223ee7ba5486713c63f944699fd6285af96 (patch) | |
tree | fb7582a0413fec0816cda3b7375235aa372bcb0c /x.c | |
parent | 5535c1f04c665c05faff2a65d5558246b7748d49 (diff) | |
download | st-patched-732be223ee7ba5486713c63f944699fd6285af96.tar.bz2 st-patched-732be223ee7ba5486713c63f944699fd6285af96.tar.xz st-patched-732be223ee7ba5486713c63f944699fd6285af96.zip |
Revert "Fix crash when cursor color is truecolor"
This reverts commit 5535c1f04c665c05faff2a65d5558246b7748d49.
Diffstat (limited to 'x.c')
-rw-r--r-- | x.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -1404,7 +1404,6 @@ 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; | ||
1408 | 1407 | ||
1409 | /* remove the old cursor */ | 1408 | /* remove the old cursor */ |
1410 | if (selected(ox, oy)) | 1409 | if (selected(ox, oy)) |
@@ -1420,22 +1419,14 @@ xdrawcursor(int cx, int cy, Glyph g, int ox, int oy, Glyph og) | |||
1420 | 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; |
1421 | 1420 | ||
1422 | if (selected(cx, cy)) { | 1421 | if (selected(cx, cy)) { |
1423 | cc = g.bg; | 1422 | drawcol = dc.col[g.bg]; |
1424 | } else { | 1423 | } else { |
1425 | g.mode |= ATTR_REVERSE; | 1424 | 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 | cc = g.fg + 8; | 1427 | drawcol = dc.col[g.fg + 8]; |
1428 | else | 1428 | else |
1429 | cc = g.fg; | 1429 | drawcol = dc.col[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]; | ||
1439 | } | 1430 | } |
1440 | 1431 | ||
1441 | if (IS_SET(MODE_REVERSE)) { | 1432 | if (IS_SET(MODE_REVERSE)) { |