Skip to content

Conversation

@heoh
Copy link
Contributor

@heoh heoh commented Jun 11, 2025

Fix scrolling of markdown preview at EOF. This PR fixes #249278.

  • Remove logic that causes scroll errors.

Cause

  • At EOF, scroll synchronization is performed every time a character is typed.
  • At EOF, the calculated scrollTo is very small, less than 1, but the postprocessing scrolls more than necessary.
    This causes errors again, and to reduce this error, scrollTo is set in the opposite direction again.
  • This eventually repeats with every typing, occurs a "crawls" issue.

Resolve

  1. First, I removed the logic that causes errors.

  2. I checked the history at the time by finding the PR and Issue where the code was written. (457acf8, Fix scrolling of markdown preview. Close #65504 #111094)
    The code was originally written intentionally to fix an old another scrolling issue.
    However, I tested it myself, and the issue that was there before is no longer occurring.

Test

I have tested this PR with the document referenced by previous contributors https://github.com/jlelong/LaTeX-Workshop-wiki/blob/master/Hover.md.

Before

before

After

after

Test previous issue

test-old-issue

Copy link
Collaborator

@mjbvz mjbvz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mjbvz mjbvz enabled auto-merge June 11, 2025 22:30
@mjbvz mjbvz added this to the June 2025 milestone Jun 11, 2025
@mjbvz mjbvz merged commit b104f81 into microsoft:main Jun 11, 2025
7 checks passed
@stephenatwork
Copy link
Member

Lovely writeup. Thanks @heoh!

@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Jul 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Markdown preview scroll "crawls" at EOF

4 participants