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

Code scrolls when typing with markdown preview open #65504

Closed
the-ress opened this issue Dec 20, 2018 · 21 comments · Fixed by #111094
Closed

Code scrolls when typing with markdown preview open #65504

the-ress opened this issue Dec 20, 2018 · 21 comments · Fixed by #111094
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders markdown Markdown support issues verified Verification succeeded
Milestone

Comments

@the-ress
Copy link
Contributor

Issue Type: Bug

VS Code version: Code 1.30.1 (dea8705, 2018-12-18T18:12:07.165Z)
VS Code version: Code - Insiders 1.31.0-insider (2803a86, 2018-12-20T09:10:39.545Z)
OS version: Windows_NT x64 10.0.17134

Steps to Reproduce:

  1. Open a markdown file longer than your screen height
  2. Move text cursor near the end of the file
  3. Type

Expected result: Markdown preview doesn't affect code scroll position unless I directly scroll the preview.

Actual result: Code scrolls around when typing.

vscode-markdown

Does this issue occur when all extensions are disabled?: Yes

System Info
Item Value
CPUs Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz (4 x 2496)
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) 7.87GB (1.06GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (63)
Extension Author (truncated) Version
livs abh 1.0.6
html-snippets abu 0.2.1
vscode-base64 ada 0.1.0
vscode-caniuse aka 0.5.3
ts-loader-problem-matcher alq 0.3.0
random-string-password-generator bib 1.0.2
unique-lines bib 1.0.0
cobol bit 4.0.0
simple-react-snippets bur 1.2.2
npm-intellisense chr 1.3.0
path-intellisense chr 1.4.2
gitignore cod 0.6.0
indent4to2 Com 0.1.2
vscode-svgviewer css 1.4.7
vscode-gist dba 1.0.0
xml Dot 2.4.0
vscode-generate-getter-setter DSK 0.5.0
vscode-babel-coloring dza 0.0.4
EditorConfig Edi 0.12.5
tslint eg2 1.0.42
vscode-npm-script eg2 0.3.5
php-debug fel 1.12.6
php-intellisense fel 2.3.10
php-pack fel 1.0.2
vscode-solution-explorer fer 0.3.0
vscode-auto-open-markdown-preview hnw 0.0.4
beautify Hoo 1.4.7
Ionide-FAKE Ion 1.2.3
Ionide-Paket Ion 1.12.0
reg ion 0.0.2
debugger-for-phantomjs ira 0.1.1
csharpextensions jch 1.3.0
jenkins-declarative-support jmM 0.1.0
latte Kas 0.1.1
refactorix kri 0.3.6
tgit-cmds mbi 1.2.0
sort-typescript-imports mic 1.4.1
xml-format mik 1.0.1
ecdc mit 0.12.0
mssql ms- 1.4.0
cpptools ms- 0.20.1
csharp ms- 1.17.1
mono-debug ms- 0.15.8
node-debug2 ms- 1.31.1
PowerShell ms- 1.10.2
team ms- 1.144.1
debugger-for-chrome msj 4.11.1
quicktype qui 12.0.46
vscode-sort-json ric 1.13.0
vscode-icons rob 8.0.0
annotator ryu 0.11.0
partial-diff ryu 1.4.0
jenkinsfile-support sec 0.1.0
code-settings-sync Sha 3.2.4
trailing-spaces sha 0.2.11
vscode-hexdump sle 1.7.2
rewrap stk 1.9.1
es-quotes vil 0.2.6
vscode-react-native vsm 0.7.0
change-case wma 1.0.0
JavaScriptSnippets xab 1.7.1
editorconfig-vscode-snippet zgu 0.2.0
vscode-open-in-github ziy 1.3.6
@vscodebot vscodebot bot added the markdown Markdown support issues label Dec 20, 2018
@IgorKrupenja
Copy link

This looks like a duplicate of #53545

@mjbvz
Copy link
Contributor

mjbvz commented Dec 28, 2018

Please share the source of your markdown file

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Dec 28, 2018
@the-ress
Copy link
Contributor Author

the-ress commented Jan 2, 2019

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Jan 2, 2019
@mjbvz mjbvz added this to the December/January 2019 milestone Jan 2, 2019
@mjbvz mjbvz closed this as completed in cba84fb Jan 2, 2019
@sbatten sbatten added the verification-found Issue verification failed label Jan 31, 2019
@sbatten
Copy link
Member

sbatten commented Jan 31, 2019

@mjbvz I'm seeing the same behavior as OP with provided file still

@sbatten sbatten reopened this Jan 31, 2019
@mjbvz mjbvz modified the milestones: December/January 2019, Backlog Jan 31, 2019
@mjbvz mjbvz removed the verification-found Issue verification failed label Jan 31, 2019
@mjbvz mjbvz added the help wanted Issues identified as good community contribution opportunities label Feb 22, 2019
@glennbarrett
Copy link

I am seeing this on Version 1.35.1 for MacOS. Just did a google search after I experienced this issue and came across this thread. I also had a pending update to 1.36.0 that I installed, and still see the same behavior.

@BjoernPetersen
Copy link

I'm experiencing the same issue. It seems to be somehow caused by a lot of badges/shields in one line.

Here is my affected file: https://gist.github.com/BjoernPetersen/0510004e98161626741e31adc4400109

@Kwaadpepper
Copy link

Kwaadpepper commented Sep 15, 2019

Hi there also have this nasty bug with this file
https://gist.github.com/Kwaadpepper/a4568f1ed718cab1ec3b59d3d7ac3e76

Annotation 2019-09-15 082935

As for markdown related extension, I have

Nom : Markdown All in One
ID : yzhang.markdown-all-in-one
Description : All you need to write Markdown (keyboard shortcuts, table of contents, auto preview and more)
Version : 2.4.2
Serveur de publication : Yu Zhang
Lien de la Place de marché pour VS : https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one

Nom : markdownlint
ID : davidanson.vscode-markdownlint
Description : Markdown linting and style checking for Visual Studio Code
Version : 0.30.2
Serveur de publication : David Anson
Lien de la Place de marché pour VS : https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint

It looks like the file Windows scrolls when typing just a bit and preview windows have difficulties to follow and desynchronizes itself. Making a mouse quick scroll replaces things right.

EDIT: I can confirm removing badges solves this issue.

EDIT 2:
Annotation 2019-09-15 085119

Broke image link in preview windows causes this erratic behaviour.

[![GitHub version](https://badge.fury.io/gh/kwaadpepper%2Flaravel-responsivefilemanager.svg)](https://badge.fury.io/gh/kwaadpepper%2Flaravel-responsivefilemanager)

Here is HTTP headers for https://badge.fury.io/gh/kwaadpepper/laravel-responsivefilemanager.svg answer
It comes with no html content

HTTP/1.1 404 Not Found
Server: Cowboy
Date: Sun, 15 Sep 2019 06:53:29 GMT
Connection: keep-alive
Content-Type: application/octet-stream
X-Request-Id: 97612d01-06de-4259-9674-304cfdc56f55
X-Runtime: 0.008840
Access-Control-Allow-Origin: https://badge.fury.io
Access-Control-Allow-Methods: GET
Access-Control-Allow-Headers: x-requested-with
Access-Control-Max-Age: 3628800
Vary: Accept-Encoding
Content-Encoding: gzip
Transfer-Encoding: chunked
Via: 1.1 vegur

And for link anwser https://badge.fury.io/gh/kwaadpepper/laravel-responsivefilemanager
It comes with a small html 404 content

HTTP/1.1 404 Not Found
Server: Cowboy
Date: Sun, 15 Sep 2019 06:54:53 GMT
Connection: keep-alive
Content-Type: text/html; charset=utf-8
X-Request-Id: 1fbadc19-b7ea-4d74-b4b7-2261dc93b16d
X-Runtime: 0.006767
Vary: Accept-Encoding
Content-Encoding: gzip
Transfer-Encoding: chunked
Via: 1.1 vegur

If I put html content it works ok

<a href="https://badge.fury.io/gh/Kwaadpepper%2Flaravel-responsivefilemanager"><img src="https://badge.fury.io/gh/Kwaadpepper%2Flaravel-responsivefilemanager.svg" alt="GitHub version" height="18"></a>

@gmccullo
Copy link

gmccullo commented Oct 7, 2019

I see this behavior consistently if there is a scaled image in the preview pane. In my CSS I set the max-width of images to 100%. I think this is what produces the issue.

@gmccullo
Copy link

Another clue: turning off markdown.preview.scrollPreviewWithEditor prevents the problem (but also obviously stops the preview position from synching with the editor).

@gmccullo
Copy link

I think the problem went away in the previous release. At least I didn't notice it. But now it's back again. Very frustrating bug.

@andy3520
Copy link

Face the same problem with this version
image

Have to use https://hackmd.io/ instead of it because of this annoying bug

@ghost
Copy link

ghost commented Oct 28, 2020

Same issue. for me it scrolls upwards.

vs

Screenshot 2020-10-28 at 12 52 31 PM

Related to #89930?

@buzhangjiuzhou
Copy link

I have the same issue, and I noticed that once I insert an image in it ,this will happen, but when I didn't have images in it, the preview works fine, it has been there for many versions and I nearly encounter it with every version I've used(from the mid of last year.).

@pacharanero
Copy link

Also experiencing this issue, which seems to be new (I've previously edited the same document in Markdown Preview mode without having the page scrolling up one line every time I type a character)

It's been reported a number of times it seems. There's a closed issue here #57216

@buzhangjiuzhou
Copy link

I have the same issue, and I noticed that once I insert an image in it ,this will happen, but when I didn't have images in it, the preview works fine, it has been there for many versions and I nearly encounter it with every version I've used(from the mid of last year.).

With the latest version, 1.51.1, this was fixed, thank you !

@fwarmuth
Copy link

Still reproducible with 1.51.1!
As mentioned is comment out my embedded images, which solved the issue for me...

@vii33
Copy link

vii33 commented Dec 15, 2020

The bug is still open on v1.52.0.

Version: 1.52.0 (system setup)
Commit: 940b5f4
Date: 2020-12-10T22:45:11.850Z
Electron: 9.3.5
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19042

@HitenBhavsarMSFT
Copy link

I used workaround by open 2 visual code editor, one with readme editor and other with readme Preview. This have stopped the scrolling to the middle on the readme editor. which work much faster.

mjbvz pushed a commit that referenced this issue Jan 15, 2021
* Fix scrolling of markdown preview.

* Use scrollDisabledCount.

* Stop initializing scrollDisabledCount.

* Make scrollTo enough large to occur scroll events.

* Should resolve when the error event occurs.
@mjbvz mjbvz modified the milestones: Backlog, January 2021 Jan 15, 2021
lszomoru pushed a commit that referenced this issue Jan 15, 2021
* Fix scrolling of markdown preview.

* Use scrollDisabledCount.

* Stop initializing scrollDisabledCount.

* Make scrollTo enough large to occur scroll events.

* Should resolve when the error event occurs.
@Tyriar Tyriar added the verified Verification succeeded label Jan 28, 2021
@hxzhao527
Copy link

The bug is still open.

Version: 1.53.0
Commit: 8490d3d
Date: 2021-02-03T16:01:04.046Z (3 days ago)
Electron: 11.2.1
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Darwin x64 20.2.0

@tamuratak
Copy link
Contributor

tamuratak commented Feb 7, 2021

See #115864 (comment).

You should try disabling all the extensions.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 1, 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 insiders-released Patch has been released in VS Code Insiders markdown Markdown support issues verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.