grid: reflow: assert there aren’t any open URIs on the last row

This commit is contained in:
Daniel Eklöf 2022-08-29 21:03:21 +02:00
parent 5c86358cd1
commit 454c82f0f5
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

15
grid.c
View file

@ -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 were line-breaking due
* to a hard line-break (rather than running out of
* cells in the "new_row"), there shouldnt 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]);