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

markdown files preview does not save scroll position #63690

Closed
AbdullahWali opened this issue Nov 23, 2018 · 21 comments
Closed

markdown files preview does not save scroll position #63690

AbdullahWali opened this issue Nov 23, 2018 · 21 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities markdown Markdown support issues

Comments

@AbdullahWali
Copy link

Issue Type: Bug

  1. Open markdown file preview
  2. scroll down
  3. switch tabs and then come back to the markdown tab
    => Scroll position is reset to top

VS Code version: Code 1.28.2 (7f3ce96, 2018-10-17T00:23:51.859Z)
OS version: Windows_NT x64 10.0.17134

System Info
Item Value
CPUs Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz (8 x 1992)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Memory (System) 15.86GB (7.51GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (4)
Extension Author (truncated) Version
rdetools Blo 0.1.10
sftp lix 1.7.7
python ms- 2018.10.1
cpptools ms- 0.20.1
@vscodebot vscodebot bot added the markdown Markdown support issues label Nov 23, 2018
@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Nov 29, 2018
@skprabhanjan
Copy link
Contributor

@mjbvz , looking into this :)

@skprabhanjan
Copy link
Contributor

skprabhanjan commented Nov 29, 2018

@AbdullahWali and @mjbvz , It seems to retain the scroll position when i am trying.
I am not able to reproduce this bug.
Could you please help me more with this ?

@mjbvz
Copy link
Contributor

mjbvz commented Nov 29, 2018

@AbdullahWali Can you please share a markdown file that has this issue

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Nov 29, 2018
@Robhox
Copy link

Robhox commented Dec 4, 2018

I could reproduce the bug with any md file (on macOS and windows). The scroll position is not saved for the Mardown Preview (which you can get by pressing ⇧⌘V or Ctrl+Shift+V in a md file). The side-by-side preview is working fine.

I'm looking at this issue right now to fix it

@skprabhanjan
Copy link
Contributor

@Robhox , Thanks for the update.
Are you looking into this or should I continue solving this ?

@Robhox
Copy link

Robhox commented Dec 4, 2018

@skprabhanjan I'm already looking into it and would love to solve it if it's ok for you

@skprabhanjan
Copy link
Contributor

@Robhox , sure go ahead , seems like your first contribution , so will leave this to you :)

@Robhox
Copy link

Robhox commented Jan 9, 2019

@skprabhanjan Did you had any ideas how to fix this issue? I'm struggling to find where the position is saved when you switch tabs.

@skprabhanjan
Copy link
Contributor

@Robhox , Need to check it , Will get back to you after checking it :)

@warpdesign
Copy link
Contributor

warpdesign commented Sep 11, 2019

Also, the markdown preview seems to be reloaded/regenerated when the user switches back to a preview tab, so during ~800ms there's a blank area which I find quite annoying too.

@IgorKrupenja
Copy link

Reproducible on 1.38.1, sample file inside ZIP:
Untitled-1.md.zip

@murphyke
Copy link

murphyke commented Jan 7, 2020

This is another variation of the same situation: if you open a side-by-side preview, then open another tab in the preview sub-window, then switch back to the preview tab, the scroll position in the preview will have been lost.

@thadras
Copy link

thadras commented Feb 3, 2020

Want to report that this issue seems to reproduce for the case of using the following experimental setting as found via issue #84520:

"workbench.experimental.editorAssociations": [
    {
        "viewType": "vscode.markdown.preview.editor",
        "filenamePattern": "*.md"
    }
]

Whereby, I find it convenient to be able to open md files within the preview context. However, it appears that doing so somehow interferes with the applications scroll state when switching between tabs. As such, the file's preview tab will lose its scroll position when navigating away from and returning to the md file.

Note, I have built the VSCode application from the latest git, and out-of-box the issue does not reproduce without the experimental setting. Hence, it seems that using preview viewtype as default for md files contributes to the loss of scroll position when switching between tasks.

Given the help wanted label, I am reviewing the vscode in hopes of gaining a better understanding of the internals, but the learning curve will take some effort to surmount.

@mjbvz mjbvz removed the info-needed Issue requires more information from poster label Apr 3, 2020
@devuxer
Copy link

devuxer commented Apr 8, 2020

I've had this problem with VSCode as long as I can remember. I just installed version 1.44.0 on my Thinkpad, and it's still definitely happening. As I read through the release notes, I like to try out the new features as I read. With a document this long, it definitely causes some frustration having to keep finding my place again after each try. Hoping someone can figure out what's causing this 🙏

@n-p-e
Copy link

n-p-e commented Apr 18, 2020

The extension descriptions page (extension sidebar -> click on any extension that has a long description) has a similar issue. The page seems to reload when switching to another tab and switching back, resetting the scroll position.

Edit: Running VSCode 1.44.2 on the latest Windows (10.0.18363).

Screenshot_2020-04-18_22-22-03

@gjsjohnmurray
Copy link
Contributor

See also #27498

@leosdad
Copy link

leosdad commented Dec 11, 2020

This is very annoying and distracting especially when there is a new VS Code release, the descriptions are very long. So I'll try any new feature and when I go back to the release notes are reloads from the top and I have to scroll down again.

Please take a look at it whenever possible.

@DavidMGini

This comment has been minimized.

@mjbvz
Copy link
Contributor

mjbvz commented Oct 7, 2021

Closing as the original issue about the markdown preview has been fixed for a while now:

recording

If there's a specific file / scenario where it isn't working properly, please open a new issue with steps to reproduce

@mjbvz mjbvz closed this as completed Oct 7, 2021
@leosdad
Copy link

leosdad commented Oct 7, 2021

Hi @mjbvz,

Thanks for the feedback. However I'm not sure why it was closed, VS Code release notes still do not retain the scroll position. Instead they jump to a random point each time they get the focus back, while the scroll bar goes crazy. IMHO this is even worse than the previous situation when at least the wrong position was predictable (i.e. the start of the page) :)

2021-10-07_09-40-26

Best regards,

@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities markdown Markdown support issues
Projects
None yet
Development

No branches or pull requests