# Add scrolling functionality to markdown preview mode \(\#44585\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/07748b7baedc3f5dbd5867797545243a5ba583d4)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 07748b7baedc3f5dbd5867797545243a5ba583d4

Requested commit: 07748b7baedc3f5dbd5867797545243a5ba583d4

Commit: 07748b7baedc3f5dbd5867797545243a5ba583d4

Tree: 5524f0704a25c697a8be457ac1d47bf7c7366a70

Author: KyleBarton

Committer: GitHub

## Message

```
Add scrolling functionality to markdown preview mode (#44585)

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`
```

## Parents

- [37f2ac24b832c5afb7e4dd9fdeaa5f443ee68312](https://git.cafe/gitcafe/zed/commit/37f2ac24b832c5afb7e4dd9fdeaa5f443ee68312?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/07748b7baedc3f5dbd5867797545243a5ba583d4?format=markdown)
