Skip to content

ScrollViewer with Content-Assisted Scrolling - #671

Open
mstrobel wants to merge 9 commits into
mabe02:masterfrom
mstrobel:scroll-viewer
Open

ScrollViewer with Content-Assisted Scrolling#671
mstrobel wants to merge 9 commits into
mabe02:masterfrom
mstrobel:scroll-viewer

Conversation

@mstrobel

@mstrobel mstrobel commented Aug 24, 2026

Copy link
Copy Markdown

I actually wrote this about eight years ago, but never got around to finishing it until your repo caught my eye in my starred list this weekend. If I recall, it's more or less complete. The only issue I could remember was that cursors would continue to paint even when their owner controls were scrolled out of view. I added a fix for that today.

I was able to build a really slick internal tool for inspecting a proprietary shared memory database with Lanterna at my last job, and I wanted to give something back. Hopefully you'll find it useful.

I'm sure there's a bug or two, but give it a go and see what you think. There's an interactive test/demo called ScrollControllerTest that lets you toggle content-assisted scrolling. It renders a checkerboard, and depending on whether the assist is enabled, it will either scroll normally by lines/columns or will snap to the squares' edges.

I'd wanted to include a proof-of-concept for hosting your Table where it would snap to column/row boundaries when scrolling, but I never got around to it.

@MartyIX

MartyIX commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I'm sure there's a bug or two, but give it a go and see what you think. There's an interactive test/demo called ScrollControllerTest that lets you toggle content-assisted scrolling. It renders a checkerboard, and depending on whether the assist is enabled, it will either scroll normally by lines/columns or will snap to the squares' edges.

A screenshot would be nice :)

@mstrobel

mstrobel commented Aug 26, 2026

Copy link
Copy Markdown
Author

A screenshot would be nice :)

I tried to do a screen recording, but the recorder kept trying to time my keystrokes according to a normal typing cadence, and you ended up not being able to really see any of the scrolling. But here's a still.
scrollviewer

With the checkbox checked, scrolling along either axis scrolls exactly one tile into view. Unchecked, it scrolls by one line/column at a time.

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.

2 participants