This improves the text reflow performance when there are lots of OSC-8 URI ranges in the grid.
Since we know the following:
- URI ranges are sorted
- URI coordinates are unique
- URI ranges don’t span multiple rows
We can optimize URI range reflowing by:
- Checking if the first URI range’s start coordinate is on the current column. If so, keep a pointer to it.
- Use this pointer as source when instantiating the reflowed URI range.
- If we already have a non-NULL range pointer, check its end coordinate instead.
- If it matches, close the last URI range we inserted on the new row, and free/remove the range from the old row.
- When line breaking, we only need to check if the last URI range is unclosed.
Part of #504
This improves the text reflow performance when there are lots of OSC-8 URI ranges in the grid.
Since we know the following:
* URI ranges are sorted
* URI coordinates are unique
* URI ranges don’t span multiple rows
We can optimize URI range reflowing by:
* Checking if the *first* URI range’s start coordinate is on the current column. If so, keep a pointer to it.
* Use this pointer as source when instantiating the reflowed URI range.
* If we already have a non-NULL range pointer, check its end coordinate instead.
* If it matches, close the *last* URI range we inserted on the new row, and free/remove the range from the old row.
* When line breaking, we only need to check if the *last* URI range is unclosed.
Part of #504