Skip to content

Vertical scroll margin broken in multibuffers #43178

@dinocosta

Description

@dinocosta

Summary

The vertical_scroll_marging setting value is not properly respected in multibuffers because of the file header component, making it possible for the selected line to hide behind the file header.

Description

When using "vertical_scroll_margin": 0, using the editor: scroll cursor top action behaves as expected in a single buffer, placing the current line at the top of the editor, with no margin lines being used. However, when working with a multibuffer, Zed is not taking the File Header element into consideration, which takes up 2 Display Rows, so the editor: scroll cursor top action ends up placing the selected line behind the file header instead of right below it.

Steps to reproduce:

  1. Set vertical_scroll_margin to 0
  2. Perform a project search that, at least, produces 1 match
  3. Run the editor: scroll cursor top action (z t in vim mode)
  4. Confirm that the selected line is now behind the file header

Expected Behavior: Zed takes the file header element into consideration when deciding the top row to use
Actual Behavior: Zed ignored the file header element and behaves as if a single buffer was being edited

settings.json
{
  "vertical_scroll_margin": 0
}
Screen Recording
CleanShot.2025-11-20.at.11.36.06.mp4

Zed Version and System Specs

Zed 0.212.7
9a06aea

If applicable, attach your Zed.log file to this issue.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:editorFeedback for code editing, formatting, editor iterations, etcarea:multi-bufferFeedback for multi buffersarea:ui/scrollingScrollbar and scrollingstate:reproducibleVerified steps to reproduce included and someone on the team managed to reproduce

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions