zed icon indicating copy to clipboard operation
zed copied to clipboard

editor: Prevent vertical scrollbar from overlapping with buffer headers

Open MrSubidubi opened this issue 8 months ago • 0 comments

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
PR PR
Fix with shortened divider pr_line_shortened

Release Notes:

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

MrSubidubi avatar May 10 '25 20:05 MrSubidubi