Skip to content

fix(layout): align diff1_inline diff computation with side-by-side layouts#126

Merged
dlyongemallo merged 1 commit intomainfrom
minor_diff1_fixes
Apr 20, 2026
Merged

fix(layout): align diff1_inline diff computation with side-by-side layouts#126
dlyongemallo merged 1 commit intomainfrom
minor_diff1_fixes

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

@dlyongemallo dlyongemallo commented Apr 20, 2026

Forward the whitespace flags (iwhite, iwhiteall, iwhiteeol, iblank) to vim.diff and drop linematch, which mis-anchors deletions in the inline renderer by pairing lines by similarity rather than position.

Copilot AI review requested due to automatic review settings April 20, 2026 05:17
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 updates the diff1_inline layout’s inline diff computation to better match the behavior of side-by-side layouts by forwarding relevant whitespace/case 'diffopt' flags to vim.diff, while intentionally excluding linematch due to incompatibility with the inline renderer’s positional hunk model. It also documents the linematch limitation for diff1_inline.

Changes:

  • Parse and forward whitespace/case-related 'diffopt' flags (e.g. iwhite, icase) to vim.diff for inline rendering.
  • Stop forwarding linematch to avoid mis-anchored deletions in the inline renderer.
  • Update user docs to clarify linematch support differences across layouts and document which flags diff1_inline honors.

Reviewed changes

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

File Description
lua/diffview/scene/layouts/diff_1_inline.lua Parses effective 'diffopt' and forwards whitespace/case flags while explicitly excluding linematch.
lua/diffview/scene/inline_diff.lua Extends InlineDiffOpts and forwards additional vim.diff ignore flags.
doc/diffview.txt Documents that linematch is not used by diff1_inline and clarifies which flags are honored.

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

Comment thread lua/diffview/scene/inline_diff.lua
Comment thread lua/diffview/scene/layouts/diff_1_inline.lua
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 4 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread lua/diffview/scene/inline_diff.lua
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 4 out of 4 changed files in this pull request and generated 1 comment.


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

Comment thread lua/diffview/tests/functional/layouts_spec.lua
…layouts

Forward the whitespace flags (`iwhite`, `iwhiteall`, `iwhiteeol`, `iblank`)
to `vim.diff` and drop `linematch`, which mis-anchors deletions in the
inline renderer by pairing lines by similarity rather than position.
@dlyongemallo dlyongemallo merged commit 1e5458d into main Apr 20, 2026
2 checks passed
@dlyongemallo dlyongemallo deleted the minor_diff1_fixes branch April 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