Mitchell Hashimoto cd2e2b801a Screen.cursorScrollAboveRotate memory corruption fix (#3129)
Extracted from #3110

Initial fix is relatively basic, and catching it with a test only
required a little bit of extra scrutiny of the cursor state after one of
the tests that we already had.

However, the fix revealed faulty dirty tracking logic throughout the
`cursorScrollAbove` function (and therefore bad results that were being
tested for when they should not have been). I've ended up clarifying
things, fixing the asserted dirty states in all the `cursorScrollAbove`
tests, and then finally implementing another very trivial fix that
catches the mistake.

Fixing the dirty tracking is really just an exercise in correctness
though, since when the scroll happens it inherently invalidates the
viewport, and therefore will trigger a full rebuild in the renderer...
unless, I guess, another operation is performed that cancels things out
and results in the viewport pin being in the same place as the previous
render, but that seems an exceptionally difficult scenario to make
happen on purpose much less accidentally.

This PR is almost entirely changes to comments and tests, there are only
2 lines of real code it changes, the one added to the start of
`cursorScrollAbove` and the one modified at the start of
`cursorScrollAboveRotate`. I believe these changes are entirely safe. (I
wonder if they might have a bad effect on our `vtebench` scrolling
performance though...)
2024-12-26 06:30:27 -08:00
..
2024-12-03 15:53:12 -08:00
2024-06-24 15:16:24 -07:00
2024-08-05 13:56:57 +02:00
2024-12-04 12:38:40 -08:00
2024-03-22 20:28:05 -07:00
2024-12-25 00:20:06 -08:00
2024-06-24 15:16:24 -07:00