Repository navigation
fix(textview): paint the requested scroll line in the current frame - #59
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this changes
Lay out a scrolling text view at the offset requested by View.ScrollTo during the same paint. Add a headless regression that jumps to line 115 and then back to line 4 and checks each target immediately after one paint.
Why
A console search can jump from the end to a distant match. ScrollArea captured the previous offset before the text view processed the request. The state was updated, but the layout still used the old offset. Refs 1lck/Lithe-IDEA#1820.
How it was verified
On macOS the new test failed on the original code at line 115. With the fix, go test ./ui/textview -count=1 passes.
Visual evidence
Run TestScrollToPaintsTheRequestedLineImmediately. PointOf rejects coordinates clipped out of the viewport after the first paint.
Where the boundary sits
This is shared text view scrolling behavior.
Cost
One assignment on a successful explicit scroll request. No added allocations or work on ordinary paints.