Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode jumpiness when editing markdown and preview pane is open

This problem comes and goes, but it's been getting unbearable as times goes on.

The environment:

I am using the latest version of VSCode (1.45.1) on a mac running OSX 10.15.4. with a minimal set of extensions (I have disabled everything I can), namely:

  • Markdown All in One 2.8.0
  • Markdown Preview Mermaid
  • Markdownlint 0.35.1

The problem:

When I am editing a Markdown document with preview alongside it, the text window jumps with the cursor location moving up the window to the point of disappearing at the top.

I am not sure exactly what triggers this behavior, but I suspect it has to do with using any sort of graphic rendering, be it MathJax, Mermaid, or a simple figure.

Online searches show similar behavior reported, and supposedly corrected, several years ago. But nothing recent which surprises me as it is maddening.

The question

Anyone has seen this behavior?

Any idea what could be triggering it?

Update:

  1. After more than a week trying to fix this, a couple hours after posting this question (and with no changes that I can think of on my part, it seems to have fixed itself). I am just waiting for the problem to come back. This is infuriating.
  2. Of course, a mere few hours afterwards the same problem came back. It seems to be some specific property of the markdown file as two different computers with different screen and window sizes started and stopped behaving exactly the same way with the same files.
  3. At the suggestion of @user8682688, who found the settings for the scroll synchronization in VSCode, I turned off synchronization from the preview window back into the editor ("markdown.preview.scrollEditorWithPreview": false) this at least removed the jumping from the the editor window making it usable again, but the preview window is still jumping all over the place which is the actual bug. Of course, I could disable the updating altogether with markdown.preview.scrollPreviewWithEditor, but that's just a work-around that removes useful functionality.
like image 914
Edgar Brown Avatar asked May 16 '20 02:05

Edgar Brown


People also ask

How do I turn off VS Code preview?

The only way to disable file previewing when clicked on at all is by setting "workbench. editor. enablePreview" to false .

How do I get rid of the side preview pane in VS Code?

Ctrl + Shift + P write Toggle minimap and hit enter and it's gone.

Can you preview Markdown in VS Code?

VS Code supports Markdown files out of the box. You just start writing Markdown text, save the file with the .md extension and then you can toggle the visualization of the editor between the code and the preview of the Markdown file; obviously, you can also open an existing Markdown file and start working with it.

What is Markdown preview enhanced?

Markdown Preview Enhanced is an extension that provides you with many useful functionalities such as automatic scroll sync, math typesetting, mermaid, PlantUML, pandoc, PDF export, code chunk, presentation writer, etc. A lot of its ideas are inspired by Markdown Preview Plus and RStudio Markdown.


Video Answer


1 Answers

VSCode automatically synchronizes the Markdown editor and the preview panes. Have you tried to disable the markdown.preview.scrollPreviewWithEditor and markdown.preview.scrollEditorWithPreview settings?

ref: https://code.visualstudio.com/docs/languages/markdown#_editor-and-preview-synchronization

like image 139
user8682688 Avatar answered Nov 13 '22 13:11

user8682688