Repository navigation
Fix: tab switch restores exact scroll position within page - #9
Merged
Merged
Conversation
Switching tabs now captures the outgoing tab's exact visible location (page + point, from PDFView.currentDestination) and, when switching back, navigates to that captured destination instead of only the page top. Pending navigation became convergent: applyPendingNavigation re-issues go(to:) one runloop turn apart until the view reports the target page (bounded by a 2s deadline), because a single deferred go around the document commit could be clobbered by PDFView's initial layout pass, silently resetting the view to page 0. Clicking the already-active tab / re-opening the already-shown file no longer reloads the document (which would reset the position).
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.
Switching tabs captures the outgoing tab's exact visible location (page + point) and switching back navigates to that captured destination instead of the page top. Pending navigation is now convergent (re-issued until the view reports the target page, 2s deadline) because a single deferred go(to:) could be clobbered by PDFView's initial layout pass, resetting to page 0. Clicking the active tab / re-opening the active file no longer reloads.