Skip to content

Add scrolling functionality to markdown preview mode#44585

Merged
KyleBarton merged 6 commits intomainfrom
add_scrolling_functionality_to_markdown_preview_21324
Dec 11, 2025
Merged

Add scrolling functionality to markdown preview mode#44585
KyleBarton merged 6 commits intomainfrom
add_scrolling_functionality_to_markdown_preview_21324

Conversation

@KyleBarton
Copy link
Collaborator

@KyleBarton KyleBarton commented Dec 10, 2025

Closes #21324

Adds four new commands:

  • markdown::MoveUp, markdown::MoveDown - these scroll up and down in markdown preview mode, by no more than the height of a large headline.

  • markdown::MoveUpByItem, and markdown::MoveDownByItem - these scroll up and down by the height of the item at the top of the markdown preview window. So headlines and large codeblocks, for instance, scroll further than individual paragraph lines.

Also attempts to create sensible defaults:
down -> markdown::ScrollDown
up -> markdown::ScrollUp
alt-down -> markdown::ScrollDownByItem
alt-up -> markdown::ScrollUpByItem

And in Vim:

ctrl-u -> markdown::ScrollPageUp
ctrl-d -> markdown::ScrollPageDown
ctrl-e -> markdown::ScrollDown
ctrl-y -> markdown::ScrollUp

Release Notes:

  • Added commands markdown::ScrollUp, markdown::ScrollDown, markdown::ScrollUpByItem, and markdown::ScrollDownByItem
  • Changed commands markdown::MovePageUp to markdown::ScrollPageUp and markdown::MovePageDown to markdown::ScrollPageDown

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Dec 10, 2025
@KyleBarton KyleBarton enabled auto-merge (squash) December 11, 2025 21:31
@KyleBarton KyleBarton merged commit 07748b7 into main Dec 11, 2025
23 checks passed
@KyleBarton KyleBarton deleted the add_scrolling_functionality_to_markdown_preview_21324 branch December 11, 2025 22:18
nrbnlulu pushed a commit to nrbnlulu/zed that referenced this pull request Dec 14, 2025
…44585)

Closes zed-industries#21324

Adds four new commands:
- `markdown::MoveUp`, `markdown::MoveDown` - these scroll up and down in
markdown preview mode, by no more than the height of a large headline.

- `markdown::MoveUpByItem`, and `markdown::MoveDownByItem` - these
scroll up and down by the height of the item at the top of the markdown
preview window. So headlines and large codeblocks, for instance, scroll
further than individual paragraph lines.

Also attempts to create sensible defaults:
`down` -> `markdown::ScrollDown`
`up` -> `markdown::ScrollUp`
`alt-down` -> `markdown::ScrollDownByItem`
`alt-up` -> `markdown::ScrollUpByItem`

And in Vim:

`ctrl-u` -> `markdown::ScrollPageUp`
`ctrl-d` -> `markdown::ScrollPageDown`
`ctrl-e` -> `markdown::ScrollDown`
`ctrl-y` -> `markdown::ScrollUp`


Release Notes:

- Added commands `markdown::ScrollUp`, `markdown::ScrollDown`,
`markdown::ScrollUpByItem`, and `markdown::ScrollDownByItem`
- Changed commands `markdown::MovePageUp` to `markdown::ScrollPageUp`
and `markdown::MovePageDown` to `markdown::ScrollPageDown`
CherryWorm pushed a commit to CherryWorm/zed that referenced this pull request Dec 16, 2025
…44585)

Closes zed-industries#21324

Adds four new commands:
- `markdown::MoveUp`, `markdown::MoveDown` - these scroll up and down in
markdown preview mode, by no more than the height of a large headline.

- `markdown::MoveUpByItem`, and `markdown::MoveDownByItem` - these
scroll up and down by the height of the item at the top of the markdown
preview window. So headlines and large codeblocks, for instance, scroll
further than individual paragraph lines.

Also attempts to create sensible defaults:
`down` -> `markdown::ScrollDown`
`up` -> `markdown::ScrollUp`
`alt-down` -> `markdown::ScrollDownByItem`
`alt-up` -> `markdown::ScrollUpByItem`

And in Vim:

`ctrl-u` -> `markdown::ScrollPageUp`
`ctrl-d` -> `markdown::ScrollPageDown`
`ctrl-e` -> `markdown::ScrollDown`
`ctrl-y` -> `markdown::ScrollUp`


Release Notes:

- Added commands `markdown::ScrollUp`, `markdown::ScrollDown`,
`markdown::ScrollUpByItem`, and `markdown::ScrollDownByItem`
- Changed commands `markdown::MovePageUp` to `markdown::ScrollPageUp`
and `markdown::MovePageDown` to `markdown::ScrollPageDown`
someone13574 pushed a commit to someone13574/zed that referenced this pull request Dec 16, 2025
…44585)

Closes zed-industries#21324

Adds four new commands:
- `markdown::MoveUp`, `markdown::MoveDown` - these scroll up and down in
markdown preview mode, by no more than the height of a large headline.

- `markdown::MoveUpByItem`, and `markdown::MoveDownByItem` - these
scroll up and down by the height of the item at the top of the markdown
preview window. So headlines and large codeblocks, for instance, scroll
further than individual paragraph lines.

Also attempts to create sensible defaults:
`down` -> `markdown::ScrollDown`
`up` -> `markdown::ScrollUp`
`alt-down` -> `markdown::ScrollDownByItem`
`alt-up` -> `markdown::ScrollUpByItem`

And in Vim:

`ctrl-u` -> `markdown::ScrollPageUp`
`ctrl-d` -> `markdown::ScrollPageDown`
`ctrl-e` -> `markdown::ScrollDown`
`ctrl-y` -> `markdown::ScrollUp`


Release Notes:

- Added commands `markdown::ScrollUp`, `markdown::ScrollDown`,
`markdown::ScrollUpByItem`, and `markdown::ScrollDownByItem`
- Changed commands `markdown::MovePageUp` to `markdown::ScrollPageUp`
and `markdown::MovePageDown` to `markdown::ScrollPageDown`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrolling shortcuts don't work in Markdown Preview

1 participant