Skip to content

fix(config): always include configured layout in layouts cycle#119

Merged
dlyongemallo merged 1 commit intomainfrom
include_configured_view_in_cycle
Apr 15, 2026
Merged

fix(config): always include configured layout in layouts cycle#119
dlyongemallo merged 1 commit intomainfrom
include_configured_view_in_cycle

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 15, 2026 19:33
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 ensures Diffview’s cycle_layout action always has a valid way to return to the view’s configured starting layout by automatically including that layout in the configured cycle list, and by fixing cycling behavior when the current layout isn’t found in the cycle.

Changes:

  • Auto-append each view’s configured layout to the corresponding view.cycle_layouts list during config.setup() (skipping the -1 sentinel).
  • Fix actions.cycle_layout() to cycle to the first entry (not the last) when the current layout is not present in the cycle list.
  • Update functional tests and documentation to reflect the new cycle resolution behavior.

Reviewed changes

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

Show a summary per file
File Description
lua/diffview/config.lua Appends configured starting layouts into cycle lists during setup to guarantee return-to-start cycling.
lua/diffview/actions.lua Adjusts cycle index computation to handle “not found” layouts correctly.
lua/diffview/tests/functional/cycle_layouts_spec.lua Adds/updates tests for auto-insertion and the “not found goes to first” behavior.
doc/diffview_defaults.txt Documents that configured layouts are auto-appended to cycles by setup.
doc/diffview.txt Expands config docs for view.cycle_layouts to describe the auto-append behavior.

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

Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
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

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


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

Comment thread lua/diffview/config.lua Outdated
Comment thread lua/diffview/config.lua Outdated
Comment thread doc/diffview_defaults.txt
Comment thread doc/diffview.txt Outdated
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

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


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

Comment thread doc/diffview.txt Outdated
Comment thread doc/diffview.txt Outdated
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

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


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

@dlyongemallo dlyongemallo merged commit dde44b2 into main Apr 15, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the include_configured_view_in_cycle branch April 16, 2026 17:00
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