From 466466c19e6d4ddf6a90e6fb7f498225890cef4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 14 Jul 2020 12:03:10 +0200 Subject: [PATCH] grid: reflow: use width=1 for invalid characters --- grid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grid.c b/grid.c index 561598f9..3a170c1c 100644 --- a/grid.c +++ b/grid.c @@ -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);