mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
grid: reflow: assert there aren’t any open URIs on the last row
This commit is contained in:
parent
5c86358cd1
commit
454c82f0f5
1 changed files with 15 additions and 0 deletions
15
grid.c
15
grid.c
|
|
@ -943,6 +943,21 @@ grid_resize_and_reflow(
|
|||
|
||||
if (r + 1 < old_rows)
|
||||
line_wrap();
|
||||
else if (new_row->extra != NULL &&
|
||||
new_row->extra->uri_ranges.count > 0)
|
||||
{
|
||||
/*
|
||||
* line_wrap() "closes" still-open URIs. Since this is
|
||||
* the *last* row, and since we’re line-breaking due
|
||||
* to a hard line-break (rather than running out of
|
||||
* cells in the "new_row"), there shouldn’t be an open
|
||||
* URI (it would have been closed when we reached the
|
||||
* end of the URI while reflowing the last "old"
|
||||
* row).
|
||||
*/
|
||||
uint32_t last_idx = new_row->extra->uri_ranges.count - 1;
|
||||
xassert(new_row->extra->uri_ranges.v[last_idx].end >= 0);
|
||||
}
|
||||
}
|
||||
|
||||
grid_row_free(old_grid[old_row_idx]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue