Commit Graph

24 Commits

Author SHA1 Message Date
Matt Bierner
243bce7593 Merge branch 'main' into fix/janky-scrolling-in-markdown-preview 2026-03-26 15:14:38 -07:00
Matt Bierner
7df46143a1 Experiment with switching markdown extension to use native privates
Let's try this out with one extension to start
2026-03-10 23:13:16 -07:00
AshtonYoon
ce82477188 markdown: remove extra blank lines 2026-01-19 15:22:35 +09:00
AshtonYoon
8cfe3492f9 markdown: fix janky scrolling in preview with code blocks
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).
2026-01-12 12:39:02 +09:00
MohamedEmirHajji
7da4bbe808 Markdown preview: filter hidden elements from scroll sync (fix microsoft#281247) 2025-12-10 17:01:55 +01:00
MohamedEmirHajji
e04a029f0e Markdown preview: filter hidden elements from scroll sync (fix #281247) 2025-12-10 15:54:00 +01:00
heoh
53a4ef7018 Fix markdown preview scroll crawls at EOF (fix #249278) 2025-06-12 03:56:11 +09:00
Matt Bierner
924ee8b4d8 Don't scroll sync to elements inside collapsed details sections (#176541)
Fixes #176538

Turns out that `getClientBoundingRect` returns weird bounds for elements inside of a collapsed details section
2023-03-08 21:06:26 +01:00
Ely Ronnen
5b79b91838 Fix #173869 marking active line for code elements too in markdown pre… (#173870)
Fix #173869 marking active line for code elements too in markdown preview
2023-02-08 20:25:54 +00:00
ibuky
9894ae8700 fix#171379 (#172175)
Co-authored-by: VTX0 <VTX0>
2023-02-01 00:35:02 +00:00
Matt Bierner
107d3ab28c Fix markdown scrolling between elements being too jumpy (#166746)
Fixes #165055

We need to consider the distance between the end of the previous element and start of the next element. Previously we were taking distance from start of the previous to start of the next
2022-11-18 13:02:56 -08:00
Matt Bierner
4991cf2112 Remove console.log (#162784) 2022-10-05 15:25:52 -07:00
Matt Bierner
f4bf1f30a2 Skip ul and ol when highlighting selected markdown element (#161139)
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
2022-09-19 07:16:06 +02:00
Johannes Rieken
4a130c40ed enable @typescript-eslint/member-delimiter-style, https://github.com/microsoft/vscode/issues/140391 2022-02-02 14:35:33 +01:00
Matt Bierner
8f672cac62 Use morphdom to reduce number of full page updates to md preview
This should help improve scroll sync and also reduce the number of times we go out to the network if images are in the preview
2021-11-01 15:33:00 -07:00
Takashi Tamura
a34e751b01 Fix scrolling of markdown preview. Close #65504 (#111094)
* 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.
2021-01-14 17:24:08 -08:00
Matt Bierner
b10335675f Improve scroll sync for nested markdown lists
Fixes #83735
2019-11-08 18:13:01 -08:00
Matt Bierner
45a64e2bdd Improve markdown scroll sync on fenced code blocks in md files 2019-11-02 15:28:01 -07:00
Salvador Cabrera
34339f92c4 Fix: Markdown Preview scroll remains same after clicking on some other link #78465
Improves the behavior on how markdown preview behaves when clicking a link
2019-08-19 09:35:06 -05:00
Matt Bierner
003521e715 Fix markdown preview restoring to wrong position on restart 2019-02-14 18:24:01 -08:00
Matt Bierner
cba84fba5e Take progress within element into account for markdown scroll sync
Fixes #65504
2019-01-02 14:36:16 -08:00
Matt Bierner
907924abc0 Reveal absolute top of markdown preview when scrolling to line 0
Fixes #61816
2018-10-25 11:57:50 -07:00
Matt Bierner
fe63c7e2f2 Reveal line 0 in editor when markdown preview scrolls to top
Fixes #61815
2018-10-25 11:57:50 -07:00
Matt Bierner
468dc867cd Rename markdown to markdown-language-features 2018-03-19 21:08:39 -07:00