aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 09:03:33 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 09:03:33 +0000
commit803c87bb6565f09a60e4fa01c71bc1d43b4ebecd (patch)
treeab04886ef1980ccde89c1885e05c204d6f689db8 /grid.c
parentterm: print: force line-wrap if a multi-column character does not fit on current line (diff)
grid: reflow: force line-wrap if a multi-column character does not fit on current line
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c15
1 files changed, 1 insertions, 14 deletions
diff --git a/grid.c b/grid.c
index cdc5db72..561598f9 100644
--- a/grid.c
+++ b/grid.c
@@ -221,21 +221,8 @@ 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 >= new_cols) {
-#if 0
- /*
- * If last cell on last row and first cell on new
- * row are non-empty, wrap the line, otherwise
- * insert a hard line break.
- */
- if (new_row->cells[new_cols - 1].wc == 0 ||
- old_cell->wc == 0)
- {
- new_row->linebreak = true;
- }
-#endif
+ if (new_col_idx + wcwidth(old_cell->wc) > new_cols)
line_wrap();
- }
assert(new_row != NULL);
assert(new_col_idx >= 0);