diff options
author | nicm <nicm> | 2021-10-26 12:22:23 +0000 |
---|---|---|
committer | nicm <nicm> | 2021-10-26 12:22:23 +0000 |
commit | 5745bd27fdfd0e806fb3f734966f66f302c76c48 (patch) | |
tree | 1c5081834d49e7821dd06ee8174dcab18cff4724 /format-draw.c | |
parent | 197a116f5a2146309c4c6fecbd9d08d36f2be750 (diff) |
Do not allow inline styles to replace mode-style for the selected item,
from Alexis Hildebrandt in GitHub issue 2946.
Diffstat (limited to 'format-draw.c')
-rw-r--r-- | format-draw.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/format-draw.c b/format-draw.c index 6164cc44..1110535f 100644 --- a/format-draw.c +++ b/format-draw.c @@ -677,7 +677,8 @@ format_draw_many(struct screen_write_ctx *ctx, struct style *sy, char ch, /* Draw a format to a screen. */ void format_draw(struct screen_write_ctx *octx, const struct grid_cell *base, - u_int available, const char *expanded, struct style_ranges *srs) + u_int available, const char *expanded, struct style_ranges *srs, + int default_colours) { enum { LEFT, CENTRE, @@ -819,6 +820,10 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base, log_debug("%s: style '%s' -> '%s'", __func__, tmp, style_tostring(&sy)); free(tmp); + if (default_colours) { + sy.gc.bg = base->bg; + sy.gc.fg = base->fg; + } /* If this style has a fill colour, store it for later. */ if (sy.fill != 8) |