diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-04-23 19:30:47 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-04-24 08:43:20 +0000 |
| commit | 886160ba891e2ebe7b654ec29a359a1bf3a5ba7b (patch) | |
| tree | c477e813556390f5cabcd2a6c3aa07e977d3cb5c /render.c | |
| parent | Merge branch 'reveal-concealed-text-when-highlighted' (diff) | |
render: modify background color for highlighted text when fg == bg
When rendering a selected/highlighted cell where the foreground and
background colors are the same, invert the background color to make
the selected text legible.
Closes #455
Diffstat (limited to 'render.c')
| -rw-r--r-- | render.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -443,6 +443,11 @@ render_cell(struct terminal *term, pixman_image_t *pix, } } + if (unlikely(is_selected && _fg == _bg)) { + /* Invert bg when selected/highlighted text has same fg/bg */ + _bg = ~_bg; + } + if (cell->attrs.dim) _fg = color_dim(_fg); if (term->conf->bold_in_bright.enabled && cell->attrs.bold) |
