The end-of-document drift still reported in #205 has a concrete cause in the current pixel-ratio mapping: Editor.svelte enables Monaco scrollBeyondLastLine, then uses getScrollHeight() - layout.height as the synchronization range. The extra bottom padding is not document content, so reaching the final rendered line produces a ratio below 1 and leaves the preview visibly above its end. The inverse direction can place the editor in blank padding.
Keep the editor preference, but calculate the editor synchronization range from Monaco content height rather than scroll height. Use the same content range for both emitting and applying sync positions; retain the existing front-matter segmentation. Add a regression test for the invariant. This follows #205 and #304.
The end-of-document drift still reported in #205 has a concrete cause in the current pixel-ratio mapping:
Editor.svelteenables MonacoscrollBeyondLastLine, then usesgetScrollHeight() - layout.heightas the synchronization range. The extra bottom padding is not document content, so reaching the final rendered line produces a ratio below 1 and leaves the preview visibly above its end. The inverse direction can place the editor in blank padding.Keep the editor preference, but calculate the editor synchronization range from Monaco content height rather than scroll height. Use the same content range for both emitting and applying sync positions; retain the existing front-matter segmentation. Add a regression test for the invariant. This follows #205 and #304.