ZIm/crates/editor
Finn Evers 09ace088ac
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.
2025-05-11 17:54:57 +02:00
..
src editor: Prevent vertical scrollbar from overlapping with buffer headers (#30477) 2025-05-11 17:54:57 +02:00
Cargo.toml debugger: Add run to cursor and evaluate selected text actions (#28405) 2025-04-09 19:57:29 +00:00
LICENSE-GPL chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00