# editor: Prevent vertical scrollbar from overlapping with buffer headers \(\#30477\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 09ace088ac574124a260215bc5c4695566766784

Requested commit: 09ace088ac574124a260215bc5c4695566766784

Commit: 09ace088ac574124a260215bc5c4695566766784

Tree: db420760973dbdd2c4e08e38c51dd4197c7d2958

Author: Finn Evers

Committer: GitHub

## Message

```
editor: Prevent vertical scrollbar from overlapping with buffer headers (#30477)

Closes #16993

This PR fixes an issue where the vertical editor scrollbar was
overlaying with buffer headers. I fixed this by reserving space for the
scrollbar as needed which is provided by the recently introduced
`right_margin`.

Most of the diff consists of moving the `EditorMargins` creation out of
`render_block`, as the right margin is stored in this struct and moving
this out reduces the length of the parameter list of `render_blocks` by
one. I thought of this to be a small but nice side effect.

When it comes to the dividers, I decided against these considering the
margin as well, since it felt a bit off. However, I can see arguments
for these also considering the margins. I did include an image for
comparison in the list below. Happy to change this should it be
preferred the other way around.

| `main` |
![main](https://github.com/user-attachments/assets/1148a553-cf66-4ef7-b81a-9595e9b42308)
|
| --- | --- |
| PR |
![PR](https://github.com/user-attachments/assets/811c8385-0596-427f-8d09-f800cc8d7285)
|
| Fix with shortened divider |
![pr_line_shortened](https://github.com/user-attachments/assets/9938e27f-17a5-460f-99cf-47d1fab234ed)
|

Release Notes:

- Ensured that the vertical editor scrollbar no longer overlaps with
buffer headers.
```

## Parents

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

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