render: fix selected cursor cell being ‘invisble’ when background alpha is used

... by taking the cell ‘selected’ state into account when determining
whether to use the default fg or bg as the ‘text’ color.
This commit is contained in:
Daniel Eklöf 2023-02-27 17:51:29 +01:00
parent 7f26914583
commit 7a43737745
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -424,7 +424,7 @@ cursor_colors_for_cell(const struct terminal *term, const struct cell *cell,
/* We *know* this only happens when bg is the default bg
* color */
*text_color = color_hex_to_pixman(
term->reverse ? term->colors.fg : term->colors.bg);
term->reverse ^ is_selected ? term->colors.fg : term->colors.bg);
} else
*text_color = *bg;
}