Skip to content

Create new block at the end and scroll down to only show the new block#412

Merged
heyman merged 7 commits intomainfrom
dynamic-scroll-margin
Dec 25, 2025
Merged

Create new block at the end and scroll down to only show the new block#412
heyman merged 7 commits intomainfrom
dynamic-scroll-margin

Conversation

@heyman
Copy link
Copy Markdown
Owner

@heyman heyman commented Dec 22, 2025

Fixes #399

This PR adds a new command (Add new block after last, and scroll down) and changes the default key binding for C+Shift+Enter to use it. This commands inserts a new block at the end of the buffer, and then scrolls down so that only the newly created block is visible.

In addition, this PR fixes so that we use a dynamic top scrollMargin when the cursor is in the last block. This prevents the viewport to "jump up" when editing/moving the cursor on the first line(s) of the last block when we're fully scrolled down.

This makes it possible to be fully scrolled down so that only the last block is within the viewport, and edit/move around the cursor without the scroll margin causing the block above to become visible.
…d then scrolls down all the way so that only the new block is visible. Make this the default bound command for C-Shift-Enter.
@heyman heyman marked this pull request as ready for review December 25, 2025 10:44
@heyman heyman merged commit 3c6250a into main Dec 25, 2025
3 checks passed
@heyman heyman deleted the dynamic-scroll-margin branch December 25, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: Automatically scroll to only show only new section

1 participant