Skip to content

feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups - #398

Open
kikefdezl wants to merge 1 commit into
esmuellert:mainfrom
kikefdezl:main
Open

feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups#398
kikefdezl wants to merge 1 commit into
esmuellert:mainfrom
kikefdezl:main

Conversation

@kikefdezl

@kikefdezl kikefdezl commented May 23, 2026

Copy link
Copy Markdown
image

Description

When the explorer displays dozens of files, it is easy to lose track of the boundaries between Staged, Unstaged, and Conflict groups, leading to accidental staging or unstaging of the wrong files.

This PR introduces a single-line virtual spacer above group nodes to make it instantly clear where one section ends and another begins.

Implementation Details

This is handled7 at render time.

  • A dynamic line_spacers table is generated during Tree:render().
  • Any group node that isn't the first visible line in the buffer gets a margin of 1.
  • The tree renderer simply loops over this table and applies native virt_lines_above = true extmarks.
  • A test was added for this new render-time behavior

Configuration / Opt-in

This PR applies the visual separator universally without exposing new configuration options, as it feels like a sensible and universally beneficial default for the UI. However, if you prefer this to be configurable or opt-in, I would be happy to update the PR to expose a setting for it!

@h0adp0re

Copy link
Copy Markdown

What if only "Staged Changes" is present?

@kikefdezl

kikefdezl commented May 29, 2026

Copy link
Copy Markdown
Author

What if only "Staged Changes" is present?

If the Unstaged group visibility is toggled off, the Staged group will stick to the top because we only add the margin to groups that are N > 1 (first always sticks to top).

@kikefdezl kikefdezl changed the title feat(explorer): Virtual line spacer between Staged and Unstaged groups feat(explorer): Virtual line spacer between Conflict, Staged and Unstaged groups May 29, 2026
@kikefdezl
kikefdezl force-pushed the main branch 5 times, most recently from 85d0066 to 17c1e07 Compare August 3, 2026 08:03
@kikefdezl

Copy link
Copy Markdown
Author

I made some modifications, the changes are slimmer now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants