Skip to content

fix(view): skip redundant buffer re-open on update, fix window rebalance#49

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

fix(view): skip redundant buffer re-open on update, fix window rebalance#49
dlyongemallo merged 1 commit intomainfrom
skip_redundant_reopen

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 20, 2026 07:48
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’s window management during panel resizing and reduces unnecessary buffer re-opening during file list updates, aiming to prevent disruptive layout changes and redundant reloading.

Changes:

  • Switch panel resize equalization from vertical wincmd = to wincmd = to rebalance the whole tab layout when the auto-width panel changes.
  • Track the previously selected file during update_files() and only call set_file() when initialization occurs, the selected entry identity changes, or the current layout’s loaded buffers were invalidated.

Reviewed changes

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

File Description
lua/diffview/ui/panel.lua Adjusts the window rebalance command used after auto-width panel resizing.
lua/diffview/scene/views/diff/diff_view.lua Skips redundant set_file() calls on file list refresh unless reopening is actually needed.

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

@dlyongemallo dlyongemallo merged commit c84ba7a into main Mar 20, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the skip_redundant_reopen branch March 20, 2026 07:56
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