Skip to content

Fix scrollbar not resetting to top on file/tab switch (issue #75)#77

Merged
mcgivrer merged 3 commits into
developfrom
bug/reset-scrollbar
May 18, 2026
Merged

Fix scrollbar not resetting to top on file/tab switch (issue #75)#77
mcgivrer merged 3 commits into
developfrom
bug/reset-scrollbar

Conversation

@jib63

@jib63 jib63 commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Add scrollToTop() to DocumentTab (calls VirtualizedScrollPane.scrollYToPixel(0)) and invoke it in the tab-selection listener so the editor always returns to the top of the document when switching between open files.

Add scrollToTop() to DocumentTab (calls VirtualizedScrollPane.scrollYToPixel(0))
and invoke it in the tab-selection listener so the editor always returns to the
top of the document when switching between open files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jib63 jib63 requested a review from mcgivrer May 17, 2026 10:06
@mcgivrer

Copy link
Copy Markdown
Owner

This is a good feature, but I think it is only valid in "reading" mode, right?
If you are editing your file, you may have to stay at the point you are while navigating other notes?
I would propose adding a specific miscellaneous parameter in the options dialog, or making it active only in Reading mode?
What do you think?

jib63 and others added 2 commits May 18, 2026 20:30
- Sync preview scrollbar to editor position on tab switch (normal mode)
- Reset preview to top on document switch in reading mode
- Guard editor→preview scroll propagation with !readingModeActive to prevent off-screen VirtualizedScrollPane from pushing wrong scroll fractions to the preview

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mcgivrer mcgivrer merged commit ae624ec into develop May 18, 2026
1 check passed
@jib63 jib63 deleted the bug/reset-scrollbar branch May 18, 2026 20:35
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