Preserve colours in selection if the option style is default, GitHub

issue 4498.
This commit is contained in:
nicm
2025-05-12 09:17:42 +00:00
parent 6106a0f2c4
commit 367f17a4ff

View File

@ -572,7 +572,10 @@ screen_select_cell(struct screen *s, struct grid_cell *dst,
return; return;
memcpy(dst, &s->sel->cell, sizeof *dst); memcpy(dst, &s->sel->cell, sizeof *dst);
if (COLOUR_DEFAULT(dst->fg))
dst->fg = src->fg;
if (COLOUR_DEFAULT(dst->bg))
dst->bg = src->bg;
utf8_copy(&dst->data, &src->data); utf8_copy(&dst->data, &src->data);
dst->attr = dst->attr & ~GRID_ATTR_CHARSET; dst->attr = dst->attr & ~GRID_ATTR_CHARSET;
dst->attr |= src->attr & GRID_ATTR_CHARSET; dst->attr |= src->attr & GRID_ATTR_CHARSET;