diff --git a/grid.c b/grid.c index b7c0447c..eb24869d 100644 --- a/grid.c +++ b/grid.c @@ -1052,7 +1052,7 @@ grid_resize_and_reflow( */ while ( unlikely( - amount > 1 && + amount > 0 && from + amount < old_cols && old_row->cells[from + amount].wc >= CELL_SPACER + 1)) { @@ -1061,7 +1061,7 @@ grid_resize_and_reflow( } xassert( - amount == 1 || + amount <= 1 || old_row->cells[from + amount - 1].wc <= CELL_SPACER + 1); } @@ -1084,11 +1084,9 @@ grid_resize_and_reflow( if (unlikely(spacers > 0)) { xassert(new_col_idx + spacers == new_cols); - const struct cell *cell = &old_row->cells[from - 1]; - for (int i = 0; i < spacers; i++, new_col_idx++) { new_row->cells[new_col_idx].wc = CELL_SPACER; - new_row->cells[new_col_idx].attrs = cell->attrs; + new_row->cells[new_col_idx].attrs = (struct attributes){0}; } } } diff --git a/terminal.c b/terminal.c index b88a794e..bf70a37e 100644 --- a/terminal.c +++ b/terminal.c @@ -3826,7 +3826,7 @@ print_spacer(struct terminal *term, int col, int remaining) struct cell *cell = &row->cells[col]; cell->wc = CELL_SPACER + remaining; - cell->attrs = term->vt.attrs; + cell->attrs = (struct attributes){0}; } /*