Skip to content

refactor(layouts): dedupe *Pinned overrides via shared_symbols#179

Merged
dlyongemallo merged 1 commit into
mainfrom
refactor_layouts
May 19, 2026
Merged

refactor(layouts): dedupe *Pinned overrides via shared_symbols#179
dlyongemallo merged 1 commit into
mainfrom
refactor_layouts

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

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 refactors pinned layout swap behavior so shared/pinned window detachment is handled by the base Layout:detach_files_for_swap implementation instead of duplicated per pinned layout.

Changes:

  • Centralizes shared-symbol detach logic in lua/diffview/scene/layout.lua.
  • Removes duplicated detach_files_for_swap overrides from pinned Diff1/Diff2 layouts.
  • Reuses the horizontal pinned Diff2 should_null implementation for the vertical pinned variant.

Reviewed changes

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

Show a summary per file
File Description
lua/diffview/scene/layout.lua Implements shared-symbol-aware swap detachment generically.
lua/diffview/scene/layouts/diff_1_pinned.lua Removes now-redundant pinned detach override.
lua/diffview/scene/layouts/diff_1_inline_pinned.lua Relies on base shared-symbol detach behavior and updates comments.
lua/diffview/scene/layouts/diff_2_hor_pinned.lua Removes duplicated detach override and updates documentation.
lua/diffview/scene/layouts/diff_2_ver_pinned.lua Aliases shared should_null logic from horizontal pinned layout.

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

@dlyongemallo dlyongemallo merged commit d52621f into main May 19, 2026
11 checks passed
@dlyongemallo dlyongemallo deleted the refactor_layouts branch May 19, 2026 04:54
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