Files
vscode/extensions/markdown-language-features/preview-src
AshtonYoon 611bf74afd markdown: fix scroll sync regressions introduced in #287050
Two regressions from the merge of #287050:

1. preview.ts: The merge retained `this.#isScrolling = false` inside
   the early-return guard of `scrollTo()`, which was intentionally
   removed in the original PR. This resets the timer-based flag on
   the very first forward-sync call, allowing subsequent editor scroll
   events to re-trigger forward sync while reverse sync is in
   progress, causing the editor to jump back up.

2. index.ts: The PR converted `onUpdateView` from a decrement-counter
   to a timer-based approach but left initialization and resize
   handlers still using `scrollDisabledCount += 1` without a
   corresponding timer reset. The old scroll handler decremented the
   counter naturally; the new handler only returns early. As a result,
   after page load `scrollDisabledCount` stays at 1 indefinitely,
   blocking all preview-to-editor sync until the user scrolls the
   editor once.

Fixes:
- Remove the erroneous `this.#isScrolling = false` from scrollTo()
- Apply the same timer-reset pattern (200ms) to initialization and
  resize handlers so scrollDisabledCount is always auto-cleared

Fixes #307762
2026-04-04 10:14:34 +09:00
..