Repository: vscode
Issue: Markdown Preview pane Scrolling Unhelpfully
Labels: bug,help wanted,markdown

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: No, but I don't think the extension is at at fault. Please read the rest of the story.

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- VS Code Version: 1.64.2
- OS Version: Windows_NT x64 10.0.19044

So here's what happened. I began working last week on a new pet project, a silly idea for an esoteric programming language. Before I develop an interpreter around my ideas, I thought I'd lay my ideas out in full by writing out the documentation on how the project will function once it's completed.

I'm writing out my ideas in Markdown, intended for easy reading in the GitHub repo for my project. Because GitHub is the only site I ever write Markdown for as of now, I installed an extension that restyles my Markdown preview pane to GitHub's dark mode styling: [Dark Github Markdown Preview](https://marketplace.visualstudio.com/items?itemName=ozaki.markdown-github-dark).

While writing, I noticed some strange behavior in the preview pane related to scrolling. For ease of description, I used OBS to record a video of my findings:
[![vscode001-thumbnail](https://yt-embed.herokuapp.com/embed?v=0Eu_v87gQAQ)](https://youtu.be/0Eu_v87gQAQ "vscode001")

I'm not completely sure, but I think this may actually be a VSCode issue, not an issue with the extension. You see, when I disable this extension and return the preview pane to it's default, built-in styling, these issues disappear. When I took a look at the repo for this extension, though, it seemed to be just a `.css` reskin. Unless I'm a dunce and I missed something significant, there isn't really much code in this extension, and therefore the faulty scrolling would be the fault of VSCode, where the scrolling code exists.

My theory is that the scrolling code (both scrolling the preview pane when the source pane is scrolled, and scrolling the preview pane to the currently-updated spot when you type in the source pane) inside VSCode doesn't take into account the possibility that the preview pane could be restyled to different fonts, spacings, or styles. Maybe the auto-scrolling code operates based on hardcoded values for font-sizing/spacing/line-height rather than the actual size of the text as displayed, taking into account user-installed style modifications?