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.
This commit is contained in:
Daniel Eklöf 2025-02-05 11:36:53 +01:00
parent 9840204097
commit d7e8f29ee2
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

2
grid.c
View file

@ -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(