Conflict resolve.

This commit is contained in:
Michael Grant
2026-01-21 19:36:05 +00:00

View File

@@ -89,7 +89,7 @@ tty_draw_line_clear(struct tty *tty, u_int px, u_int py, u_int nx,
/* Is this cell empty? */ /* Is this cell empty? */
static u_int static u_int
tty_draw_line_get_empty(struct grid_cell *gc, u_int nx) tty_draw_line_get_empty(const struct grid_cell *gc, u_int nx)
{ {
u_int empty = 0; u_int empty = 0;
@@ -169,11 +169,15 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
break; break;
} }
if (i == 0) if (i == 0)
bg = gc.bg;
else if (screen_select_cell(s, &ngc, &gc))
bg = ngc.bg;
else
bg = defaults->bg; bg = defaults->bg;
else {
bg = gc.bg;
if (gc.flags & GRID_FLAG_SELECTED) {
memcpy(&ngc, &gc, sizeof ngc);
if (screen_select_cell(s, &ngc, &gc))
bg = ngc.bg;
}
}
tty_attributes(tty, &last, defaults, palette, s->hyperlinks); tty_attributes(tty, &last, defaults, palette, s->hyperlinks);
log_debug("%s: clearing %u padding cells", __func__, cx); log_debug("%s: clearing %u padding cells", __func__, cx);
tty_draw_line_clear(tty, atx, aty, cx, defaults, bg, 0); tty_draw_line_clear(tty, atx, aty, cx, defaults, bg, 0);
@@ -227,14 +231,17 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
gcp = tty_check_codeset(tty, &gc); gcp = tty_check_codeset(tty, &gc);
/* And for selection. */ /* And for selection. */
if (gcp->flags & GRID_FLAG_SELECTED) {
memcpy(&ngc, gcp, sizeof ngc);
if (screen_select_cell(s, &ngc, gcp)) if (screen_select_cell(s, &ngc, gcp))
gcp = &ngc; gcp = &ngc;
}
/* Work out the the empty width. */ /* Work out the the empty width. */
if (i >= ex) if (i >= ex)
empty = 1; empty = 1;
else else
empty = tty_draw_line_get_empty(&gc, nx - i); empty = tty_draw_line_get_empty(gcp, nx - i);
/* Work out the next state. */ /* Work out the next state. */
if (empty != 0) if (empty != 0)
@@ -243,7 +250,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
next_state = TTY_DRAW_LINE_SAME; next_state = TTY_DRAW_LINE_SAME;
else if (gcp->flags & GRID_FLAG_PADDING) else if (gcp->flags & GRID_FLAG_PADDING)
next_state = TTY_DRAW_LINE_PAD; next_state = TTY_DRAW_LINE_PAD;
else if (grid_cells_look_equal(&gc, &last)) { else if (grid_cells_look_equal(gcp, &last)) {
if (gcp->data.size > (sizeof buf) - len) if (gcp->data.size > (sizeof buf) - len)
next_state = TTY_DRAW_LINE_FLUSH; next_state = TTY_DRAW_LINE_FLUSH;
else else
@@ -303,7 +310,7 @@ tty_draw_line(struct tty *tty, struct screen *s, u_int px, u_int py, u_int nx,
if (empty != 0) if (empty != 0)
i += empty; i += empty;
else else
i++; i += gcp->data.width;
} }
tty->flags = (tty->flags & ~TTY_NOCURSOR)|flags; tty->flags = (tty->flags & ~TTY_NOCURSOR)|flags;