From c46c124363fad6dabd8328bdf8e15e5da8fabf7e Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Sat, 13 Jul 2024 10:19:53 +0200 Subject: render: cursor: use default fg/bg if cell fg/bg are the same When deciding which colors to use for the cursor, and the cursor text and background colors are the same, use the default fg/bg instead. Closes #1761 --- render.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'render.c') diff --git a/render.c b/render.c index 2f18ff88..fd078184 100644 --- a/render.c +++ b/render.c @@ -573,6 +573,14 @@ cursor_colors_for_cell(const struct terminal *term, const struct cell *cell, *text_color = color_hex_to_pixman(term->colors.bg); } } + + if (text_color->red == cursor_color->red && + text_color->green == cursor_color->green && + text_color->blue == cursor_color->blue) + { + *text_color = color_hex_to_pixman(term->colors.bg); + *cursor_color = color_hex_to_pixman(term->colors.fg); + } } static void -- cgit v1.3