Skip to content

Exclude Monaco bottom padding from split-scroll synchronization #315

Description

@PathGao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions