* adds proposed createQuickDiffInformation API, adopts it in markdown editor.
* Extends textEditorDiffInformation proposal instead of having new quickDiff proposal
Our current implementation has some bugs that can hide changes. However even after fixing these, I'm not 100% confident a unexpected change wont sneak through. Best to make users aware of this while also trying to prevent this
- Use `frontmatter` (one word)
- Align `Show source` icon and text with the reopen with
- Make the `Open preview` in explorer use `reopen with` instead so you can nicely toggle the opened preview
This makes scroll sync faster by using a broadcast channel instead of the normal vscode webview api. This means the two webviews can communicate with each other directly instead of having to go through the extension host and renderer each time
This adds a propose api for computing the diff between two files. Custom diff editors can use this to make sure they have the same diffs that VS Code would use in it's built-in diff editor
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
Fixes#278930
This commit fixes the scroll synchronization issues between the markdown
editor and preview when scrolling through code blocks:
1. **Code block line tracking**: Added endLine calculation for fenced
code blocks by counting newlines, enabling accurate line-to-position
mapping within multi-line code blocks.
2. **Padding-aware scrolling**: Implemented getContentBounds() to
calculate scroll positions excluding padding, preventing jumps when
scrolling through code blocks with padding.
3. **Scroll loop prevention**: Changed scroll disable flags from counters
to timer-based booleans (50ms) to prevent infinite sync loops while
maintaining smooth bidirectional synchronization.
The fix ensures smooth scrolling through code blocks without jumping or
stuttering in both directions (editor ↔ preview).