aboutsummaryrefslogtreecommitdiff
path: root/format-draw.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2019-07-29 10:51:30 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2019-07-29 10:51:30 +0100
commitda552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf (patch)
treecf9c86c3218659faf46e606a1e38bc6ebb570dcd /format-draw.c
parent5a501a8ae27c2d0128870caa48c5708e97528567 (diff)
parentb90a9fcd13f4434aed0fe1785d619aa668bbc77d (diff)
downloadrtmux-da552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf.tar.gz
rtmux-da552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf.tar.bz2
rtmux-da552eb73b80bab3c0a28dfb9ae2c75fa6d4bdaf.zip
Merge branch 'master' into 3.0-rc
Diffstat (limited to 'format-draw.c')
-rw-r--r--format-draw.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/format-draw.c b/format-draw.c
index b589ca5e..e0ca89f0 100644
--- a/format-draw.c
+++ b/format-draw.c
@@ -511,8 +511,9 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
u_int ocx = os->cx, ocy = os->cy, i, width[TOTAL];
u_int map[] = { LEFT, LEFT, CENTRE, RIGHT };
int focus_start = -1, focus_end = -1;
- int list_state = -1;
+ int list_state = -1, fill = -1;
enum style_align list_align = STYLE_ALIGN_DEFAULT;
+ struct grid_cell gc;
struct style sy;
struct utf8_data *ud = &sy.gc.data;
const char *cp, *end;
@@ -564,7 +565,7 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
cp++;
}
- /* Draw the cell to th current screen. */
+ /* Draw the cell to the current screen. */
screen_write_cell(&ctx[current], &sy.gc);
width[current] += ud->width;
continue;
@@ -590,6 +591,10 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
style_tostring(&sy));
free(tmp);
+ /* If this style has a fill colour, store it for later. */
+ if (sy.fill != 8)
+ fill = sy.fill;
+
/* Check the list state. */
switch (sy.list) {
case STYLE_LIST_ON:
@@ -711,6 +716,14 @@ format_draw(struct screen_write_ctx *octx, const struct grid_cell *base,
fr->argument, names[fr->index], fr->start, fr->end);
}
+ /* Clear the available area. */
+ if (fill != -1) {
+ memcpy(&gc, &grid_default_cell, sizeof gc);
+ gc.bg = fill;
+ for (i = 0; i < available; i++)
+ screen_write_putc(octx, &gc, ' ');
+ }
+
/*
* Draw the screens. How they are arranged depends on where the list
* appearsq.