Skip to content

fix(textview): paint the requested scroll line in the current frame - #59

Merged
1lck merged 1 commit into
mainfrom
codex/textview-scroll-request
Nov 25, 2026
Merged

1lck merged 1 commit into
mainfrom
codex/textview-scroll-request

Conversation

@1lck

@1lck 1lck commented Nov 25, 2026

Copy link
Copy Markdown

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.

@1lck
1lck marked this pull request as ready for review November 25, 2026 07:59
@1lck
1lck merged commit 36cbd3a into main Nov 25, 2026
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant