Skip to content

fix(panel): rebalance diff windows after auto-width resize#48

Merged
dlyongemallo merged 1 commit intomainfrom
balance_panel_sizes
Mar 20, 2026
Merged

fix(panel): rebalance diff windows after auto-width resize#48
dlyongemallo merged 1 commit intomainfrom
balance_panel_sizes

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 20, 2026 06:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts Diffview panel window resizing so that when an auto-width split panel changes width, the rest of the diff layout rebalances accordingly.

Changes:

  • Rebalance window sizes after an auto-width panel resize (Panel:resize()).
  • Avoid running wincmd = on FilePanel:open() / FileHistoryPanel:open() when using split + auto width (to prevent redundant/undesired equalization).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
lua/diffview/ui/panel.lua Rebalances windows after an auto-width resize by invoking window equalization before re-rendering.
lua/diffview/scene/views/file_history/file_history_panel.lua Skips wincmd = during open when split width is auto.
lua/diffview/scene/views/diff/file_panel.lua Skips wincmd = during open when split width is auto.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lua/diffview/ui/panel.lua Outdated
Comment thread lua/diffview/ui/panel.lua Outdated
@dlyongemallo dlyongemallo merged commit c032b22 into main Mar 20, 2026
2 checks passed
@dlyongemallo
Copy link
Copy Markdown
Owner Author

@copilot I think you may have been wrong about the vim.cmd("vertical wincmd =") change. Adding vertical to this seems to make the entire command do nothing.

@dlyongemallo dlyongemallo deleted the balance_panel_sizes branch March 20, 2026 07:50
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