Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Tool Preview Position #1837

Closed
awqk opened this issue Apr 29, 2024 · 2 comments · Fixed by #1846
Closed

Build Tool Preview Position #1837

awqk opened this issue Apr 29, 2024 · 2 comments · Fixed by #1846
Labels
build tool Component: Exports or the build tool usability Issue: Could do with some improvement
Milestone

Comments

@awqk
Copy link

awqk commented Apr 29, 2024

Would it be possible to remember the preview position after an update?

During the final edits, I like to view the text with a different font and/or different line wrapping, to make errors overlooked before stand out better. After a fix, it would be nice if the preview returned to its previous position, give or take a paragraph.

To view the edits, my earlier workflow was:

  • pandoc -t epub
  • reload epub reader (they usually do remember the reading position)

Now it could be, less one step:

  • refresh preview

... if it weren't for the need to find the reading position again.

@vkbo
Copy link
Owner

vkbo commented Apr 29, 2024

Sure, should be easy to add.

@vkbo vkbo added build tool Component: Exports or the build tool usability Issue: Could do with some improvement labels Apr 29, 2024
@vkbo vkbo added this to the Release 2.4.1 milestone Apr 29, 2024
@vkbo vkbo mentioned this issue May 1, 2024
6 tasks
@vkbo vkbo linked a pull request May 1, 2024 that will close this issue
6 tasks
@vkbo
Copy link
Owner

vkbo commented May 1, 2024

The code for this was already there, but since the preview window is cleared before it is updated, the scroll bar was always at 0 when its position was recorded. So it would always restore to 0 as well.

The position is now saved before the clear() call, and restored on the same timer that hides the progress wheel. If the position is restored too early, the document hasn't finished rendering, so it may not scroll all the way. The progress bar timer is on a 300 ms delay, and that should be enough.

@vkbo vkbo closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build tool Component: Exports or the build tool usability Issue: Could do with some improvement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants