Scroll Sync Do Not Function
Describe the bug Scroll Sync icon doesn't function when side by side prevview windows is open
To Reproduce Steps to reproduce the behavior: Whether you enable or disable scroll sync icon there is no effect
Expected behavior When I scroll both source code & preview should scroll in sync
Device
- OS: Win11 x64
- App Version v2.6.11
Scroll sync was rewritten in #196 (pixel-based sync positions instead of line/ratio), which first shipped in v2.6.12 — released 2026-07-13, after this report was filed against v2.6.11. Could you retest on v2.6.12? If sync works there, this issue can be closed.
looks like it is working. but sync is not perfect, I cannot share the exact file that I was using so I ask GPT to to give me a test file.
When reaching the end of the file it is quite a few lines off. I had this issue in both stress test (I asked a easier one from GPT as I thought it might be the problem with too many format and tables and charts in the hard one, but actually was in both)
Stress Test Easy.md Stress Test Hard.md
Another issue which shows a lot more on the hard one, but a little on the easy one as well, is when typing text on left side, both the right and left panel are jumping up and down for every character typed (not even doing return to the line, just typing normal chararcters). Which is highly disturbing.
Otherwise I am actually impressed by the displaying capabilities.
I traced the typing-related jump to Editor.svelte: editor-to-preview sync subscribed to onDidChangeCursorPosition, so every ordinary edit repositioned the paired pane. #304 removes that trigger and adds a regression test; real editor scroll events remain synchronized.
The reported end-of-document drift is a separate mapping/measurement problem and stays tracked here for a reproducible fixture and platform retest.
I traced the remaining end-of-document offset to Monaco’s scrollBeyondLastLine padding being included in the pixel-ratio sync range. #316 calculates the editor sync range from content height instead, while preserving the editor’s padding preference and the front-matter split. It follows #304; please retest the attached fixtures after the stack merges.
Ok. Thanks! Will have a look when it is integrated into release. Very cool project!
Fixed by #196 (refined by #304 and #316), released in v2.6.12.
The cause turned out to be the fold feature rather than the sync logic: both directions walked only the preview body's direct children, and everything after a heading is wrapped in a .foldable-content-wrapper div that carries no source-position data. So for any document starting with a heading, neither direction ever found an anchor. It now searches the whole subtree.
If you still see drift on a current build, that would be a different problem — please reopen with the document if so.
Awesome. I will test later this week.
Three separate things in this thread, at three different stages. Sync itself was fixed in v2.6.12 (#196). The panes jumping on every keystroke is fixed in v2.7.0 (#304) — editor-to-preview sync was subscribed to cursor movement, so every character repositioned the other pane. The end-of-document drift is improved but not solved: #316 stops Monaco's scroll-past-last-line padding from being counted in the sync range, which was the largest part of it, but the mapping is still proportional rather than per-block, so some drift can remain on documents with tables or images. @Guardiancelte — your two stress-test files would be the right thing to retest with.
@PathGao this is a lot better! I dont know if you prefer me replying here or in the original issue so I will do both.
(#304) fully fixed the jumping around.
(#196) and (#316) have improve the scrolling by a large margin.
Basically the easy stress test pass without issues.
For the hard one. It is a lot better and at that point it depend how much time you want to spend on this :).
At this point it might also be the desired behaviour as well.
===========================
It looks like depending if having on the mouse on the left side or the right side impact the calculation differently
Screenshot with mouse on the edit panel side, the only diffence is I scrolled one click down :
because diagrams are being used I am guessing it is messing with the calculation would be my guess, but as you can see the top title on the right is # 11. Mermaid Diagrams but on the right is Sequence Diagram
If the calculation are running based left side when I have my mouse of the left side, I would expect top titles to align.
But in the exact same location with my mouse on the right side, it smoothly move the right side.
============================
and you get more issues for large tables, smaller tables seem fine: mouse one the left side, one scroll down, it sends me to the top of the document, and it never comes back until I am passed both tables
mouse to the right side, the table display on the left, I am using scrolling up as I think it shows the issues better start with the large table just picking out on the right side, that move the bottom of the table on the left in view
then the left side is frozen until the top of the table is visible on the right side (have to scroll a lot), basically jumping a 100 lines or so. and when that unfreeze, one scroll down on the right side shot the left side all the way back down
========================
A similar issue with on scroll down jumping is happening here but not sure why: mouse on the left side, picture are taken as one scroll interval (4 scroll total), sending me in 3 seperate places in the doc:
=======================
I am running markpad is on that screen with zero in app zoom, that might impact scroll numbers or something, so making you aware