Skip to content

fix(view): defensively use tabclose! to prevent E445 on close#67

Merged
dlyongemallo merged 1 commit intomainfrom
tabpage_close
Mar 30, 2026
Merged

fix(view): defensively use tabclose! to prevent E445 on close#67
dlyongemallo merged 1 commit intomainfrom
tabpage_close

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

Relates to #66.

Copilot AI review requested due to automatic review settings March 28, 2026 09:03
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

Fixes inability to close a Diffview tabpage when another window inside that tab contains a modified buffer (E445), as reported in #66.

Changes:

  • Force tab closure in View:close() by switching from :tabclose to :tabclose! to avoid E445.
  • Add a functional regression test suite for View:close() covering modified buffers, unmodified buffers, and “closing the last tabpage” behavior.

Reviewed changes

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

File Description
lua/diffview/scene/view.lua Changes tab closing command to tabclose! to prevent E445 when modified buffers exist in other windows of the tabpage.
lua/diffview/tests/functional/view_spec.lua Adds functional tests to reproduce the E445 scenario and validate View:close() behavior across key tabpage states.

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

Comment thread lua/diffview/scene/view.lua Outdated
Comment thread lua/diffview/tests/functional/view_spec.lua Outdated
@dlyongemallo dlyongemallo merged commit 000f9ee into main Mar 30, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the tabpage_close branch March 30, 2026 08:11
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