diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-08-29 19:03:21 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-08-31 17:16:05 +0000 |
| commit | 23871d4db58d15e33e0693010373c426fc50688e (patch) | |
| tree | 41c0fc059e80f3784375813a4f0712bf42d8b848 | |
| parent | grid: reflow: don’t line-wrap the last row (diff) | |
grid: reflow: assert there aren’t any open URIs on the last row
| -rw-r--r-- | grid.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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]); |
