From 77e349d20dd86469a44d095141bc2ce6feb9446f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Fri, 5 Jul 2019 20:36:03 +0200 Subject: [PATCH] render: reverse video only reverses the default background/foreground --- render.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/render.c b/render.c index 68f25cd1..a5ed362c 100644 --- a/render.c +++ b/render.c @@ -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;