render: reverse video only reverses the default background/foreground

This commit is contained in:
Daniel Eklöf 2019-07-05 20:36:03 +02:00
parent b26e03fced
commit 77e349d20d
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -88,15 +88,11 @@ grid_render_update(struct terminal *term, struct buffer *buf, const struct damag
int height = term->cell_height;
struct rgba foreground = cell->attrs.have_foreground
? cell->attrs.foreground : term->foreground;
? cell->attrs.foreground
: !term->reverse ? term->foreground : term->background;
struct rgba background = cell->attrs.have_background
? cell->attrs.background : term->background;
if (term->reverse) {
struct rgba swap = foreground;
foreground = background;
background = swap;
}
? cell->attrs.background
: !term->reverse ? term->background : term->foreground;
if (has_cursor) {
struct rgba swap = foreground;