aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-02-05 10:36:53 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-02-06 13:02:38 +0000
commitd7e8f29ee24365a5aeeca4460afa228a32308e49 (patch)
tree5067eb9879c1b1692ed71c09c02dbfd46796aff6 /grid.c
parentterm: print-non-ascii: propagate existing forced-width (diff)
grid: reflow: get number of spacers to insert from the old grid
When checking if we're breaking in the middle of a multi-column character, we counted spacers starting from the break point. But, the character may be wider than that. Use the fact that the spacers cells encode how many *more* there are after them; when we get to the first one, we know exactly how wide the character is.
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 eb24869d..2dc4fcd5 100644
--- a/grid.c
+++ b/grid.c
@@ -1056,8 +1056,8 @@ grid_resize_and_reflow(
from + amount < old_cols &&
old_row->cells[from + amount].wc >= CELL_SPACER + 1))
{
+ spacers = old_row->cells[from + amount].wc - CELL_SPACER + 1;
amount--;
- spacers++;
}
xassert(