Various fixes for hyperlink instability #2156
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A handful of fixes mostly relating to managed memory handling, significantly improves stability of resizing with OSC8 links on screen.
clonePartialRowFrom
affecting the source row if it's on the same page, by moving hyperlink data, resulting in an invalid state due to cells marked as hyperlinks that have had their data moved elsewhere. This could be hit during scroll operations on the alt screen or with a scroll margin sinceinsertLines
anddeleteLines
useclonePartialRowFrom
with the src and dst on the same page. [No unit tests added]moveLastRowToNewPage
by resetting managed memory markers before attempting any clones that may result in the row being moved. [No unit tests added]cursorCopy
(which is, as of now, only used to transfer the cursor to and from the alt screen). Previously it would cause a crash if you switched to the alt screen while an OSC8 link was active on the cursor. [Unit tests added!]PageList.clone
to avoid a lot of excess work (which may have also had edge case logic errors somewhere in it, since this does seem to improve stability compared to not having it), making it a lot more straightforward, and actually improving screen clone times for the renderer by a significant margin. [No additional unit tests needed] (unless you can figure out what exactly the edge cases it was getting wrong were... that seems like a lot of work though.)