-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
Markdown Preview does not preserve scroll position #22995
Comments
Steps to Reproduce:
More generally than above, the "Preview" tool now (unlike previously) always resets to the top of the markdown file when you open it or go to its tab and it refreshes (or you press ctrl+shift+v). It no longer goes to the current edit (cursor) location in the raw file. It is inconvenient to repeatedly scroll down to the current edit location in long files, to preview the changes. I'm pretty sure I skipped a couple of version updates until I installed 1.11.1 today (4/9/2017), so I'm not sure when the behavior changed, but it was fairly recent, my version was not too outdated, no more than two or three updates. |
Same behavior
|
Re #22279, run into this issue while following the guidance of the project. |
@rebornix Can we try debugging through the issue on your machine this afternoon? |
I have the same problem as outlined by @slfuqua.
It worked okay in earlier versions of VS Code (I believe it worked okay in 1.10.x). |
For anyone seeing this problem, #24985 just added some basic logging to help investigate. The change be in the next insiders build. Once that is released, please download it and:
This should help me investigate what may be going wrong here |
@mjbvz Thanks very much for looking into this. Below is my output after setting markdown.trace to verbose in VS Code 1.12.0-insider. The first entry is when I click somewhere in the middle of the markdown document. The second is when I use the preview option (which still shows the very top of the document instead of where my cursor was in the actual markdown document).
I see that the "line" entry is zero. Maybe the issue is related to that? |
Thanks @chaskim! From your log, I think there's a bug in the markdown preview where using |
Potentially dup of #22420 |
Fixes microsoft#22995 **Bug** If you switch away from an editor that users a webview, the scroll position is currently not preserved. This effects our release notes and the markdown preview. The root cause is that the webview is disposed of when the view is hidden. **Fix** Add some presisted state to track scrollProgress through the webview. Use this state in the standard html editor and in the release notes.
Fixes microsoft#22995 **Bug** If you switch away from an editor that users a webview, the scroll position is currently not preserved. This effects our release notes and the markdown preview. The root cause is that the webview is disposed of when the view is hidden. **Fix** Add some presisted state to track scrollProgress through the webview. Use this state in the standard html editor and in the release notes.
* Preserve Webview Scroll Position Fixes #22995 **Bug** If you switch away from an editor that users a webview, the scroll position is currently not preserved. This effects our release notes and the markdown preview. The root cause is that the webview is disposed of when the view is hidden. **Fix** Add some presisted state to track scrollProgress through the webview. Use this state in the standard html editor and in the release notes. * Use view state * Continue prototype memento based approach * Preserve Webview Scroll Position Fixes #22995 **Bug** If you switch away from an editor that users a webview, the scroll position is currently not preserved. This effects our release notes and the markdown preview. The root cause is that the webview is disposed of when the view is hidden. **Fix** Add some presisted state to track scrollProgress through the webview. Use this state in the standard html editor and in the release notes. * Revert changes to ReleaseNotesInput
Steps to Reproduce:
My suggestion is that the scroll position of Markdown preview tab should follow its corresponding raw Markdown tab's only if the raw Markdown tab is present. If it is not present, the preview tab should preserve the last scroll position.
The text was updated successfully, but these errors were encountered: