grid: reflow: use width=1 for invalid characters

This commit is contained in:
Daniel Eklöf 2020-07-14 12:03:10 +02:00
parent 98ebb99be3
commit 466466c19e
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
grid.c
View file

@ -221,7 +221,7 @@ grid_reflow(struct grid *grid, int new_rows, int new_cols,
const struct cell *old_cell = &old_row->cells[c - empty_count + i];
/* Out of columns on current row in new grid? */
if (new_col_idx + wcwidth(old_cell->wc) > new_cols)
if (new_col_idx + max(1, wcwidth(old_cell->wc)) > new_cols)
line_wrap();
assert(new_row != NULL);