# Diff View: Scroll to center of hunks when reviewing \(\#25846\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 2d61a51ded18f0a0f928df2dbd8f5b9c34036c66

Requested commit: 2d61a51ded18f0a0f928df2dbd8f5b9c34036c66

Commit: 2d61a51ded18f0a0f928df2dbd8f5b9c34036c66

Tree: 6bf4189c783fae1031a6181872c8f53179b2e41c

Author: João Marcos

Committer: GitHub

## Message

```
Diff View: Scroll to center of hunks when reviewing (#25846)

When reviewing hunks, scroll to put them at the center of the screen
so you can better see the context around that hunk.

The field `center_cursor` was added to the actions `editor::GoToHunk`
and `editor::GoToPrevHunk`, this was set to `false` by default in
keymaps, as it wouldn't help with in-editor navigation.

The field is set to `true` for when you trigger `git::StageAndNext`
and `git::UnstageAndNext`, this is also `true` for the buttons in the
Diff View toolbar.

Release Notes:

- N/A
```

## Parents

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

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