tomoki1207 / vscode-pdfviewer

Show PDF preview in VSCode.
https://marketplace.visualstudio.com/items/tomoki1207.pdf
Other
295 stars 70 forks source link

Fix #118: Preserve the current page number and zoom level on reload. #121

Closed zamzterz closed 2 years ago

zamzterz commented 2 years ago

This is a suggestion for a fix of #118. It doesn't preserve the exact scroll location, only the page number, which will cause a jump to the top of the page on reload. But I still think it's an improvement compared to jumping back to the start of the document on each reload.

The underlying pdf.js already supports this automatically, but it relies on detecting the page was reloaded which I couldn't find any way of achieving when pdf.js is embedded in vscode like this.

tomoki1207 commented 2 years ago

LGTM, Thanks!