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).
For #269213
This adds a new eslint rule for `as any` and `<any>({... })`. We'd like to remove almost all of these, however right now the first goal is to prevent them in new code. That's why with this first PR I simply add `eslint-disable` comments for all breaks
Trying to get this change in soon after branching off for release to hopefully minimize disruption during debt week work
Fixes#243454
This restores the previous behavior. If the default security settings are used, scripts will still block blocked by the CSP. If you fully disable the security settings, then we'll try to run them
Fixes#155552
For lists, the outer ul/ol always has the same source line as the first element in the list. We should prefer using the first element in the list when highlighting the active line
This also fixes a bug where scroll sync would stop working if you added lines to the doc. This was caused by `lineCount` getting out of sync as the document is being updated. I've removed this state and made the reveal logic more robust instead
* 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.
Possibly for #102733
Tries to get users out of a potential bad state where the state was being stored as a string. Only insiders users should have hit this
Splits the preview part of the markdown preview from the dynamic preview management part of things. Static preview swap to preview the active markdown file and don't scroll sync with any other markdown files
Fixes#80680
- Always sync the current preview line number with the editor, even when `scrollEditorWithPreview` is false
- If the md file is focused and refresh is called, do not try resetting the current line to match the editor file. This mainly effects the case where `scrollEditorWithPreview` is false
Fixes#72155
Adds a constant to the api that tracks the root path for resources inside of webviews. This is required because we will not be able to use `vscode-resource:` uris on the web. Our current approach is to rewrite the html we are given but there are almost certainly going to be cases where we don't get this quite right.
Adopts the new api for the markdown preview