aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 10:03:10 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 10:03:10 +0000
commit466466c19e6d4ddf6a90e6fb7f498225890cef4d (patch)
tree609a692c4e1c82e1809de0fe3f4d803194f4aa1f /grid.c
parentterm: line-wrap: need to update grid->cur_row when we did *not* scroll (diff)
grid: reflow: use width=1 for invalid characters
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c2
1 files changed, 1 insertions, 1 deletions
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);