Skip to content

fix(actions): handle empty diff in cycle_layout#84

Merged
dlyongemallo merged 1 commit intomainfrom
improve_diff_view_open
Apr 7, 2026
Merged

fix(actions): handle empty diff in cycle_layout#84
dlyongemallo merged 1 commit intomainfrom
improve_diff_view_open

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

@dlyongemallo dlyongemallo commented Apr 6, 2026

Fixes #82.

Copilot AI review requested due to automatic review settings April 6, 2026 16:26
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 a runtime error in Diffview’s actions.cycle_layout() when invoked on a DiffView that has no current entry (e.g., an “empty diff” state), by returning early instead of iterating a nil file list.

Changes:

  • Add an early return in cycle_layout() when the computed files list is nil.
  • Add a TODO note about potentially supporting layout cycling even when the diff is empty.

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

Comment thread lua/diffview/actions.lua Outdated
@dlyongemallo dlyongemallo force-pushed the improve_diff_view_open branch from 808bfaa to ef382a5 Compare April 7, 2026 01:31
@dlyongemallo dlyongemallo merged commit 56b617b into main Apr 7, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the improve_diff_view_open branch April 7, 2026 01:48
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.

[Bug] Layout switch on empty diff causes error

2 participants