From d7e8f29ee24365a5aeeca4460afa228a32308e49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Wed, 5 Feb 2025 11:36:53 +0100 Subject: [PATCH] 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. --- grid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(