Skip to content

feat(layout): add diff1_inline unified diff view#120

Merged
dlyongemallo merged 1 commit intomainfrom
inline_diffs
Apr 18, 2026
Merged

feat(layout): add diff1_inline unified diff view#120
dlyongemallo merged 1 commit intomainfrom
inline_diffs

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

Single-window layout rendering unified diffs via extmark overlays. Style configurable via view.inline.style ("unified" default; "overleaf" for inline strikethrough deletions). ]c/[c navigate hunks.

Char-level diff helpers adapted from @tienlonghungson's sample in #109, which was modified from YouSame2/inlinediff-nvim.

Closes #108 and #109.

Copilot AI review requested due to automatic review settings April 17, 2026 02:37
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

Adds a new single-window unified (“inline”) diff layout to Diffview, rendering changes via extmarks/virtual lines and providing inline hunk navigation that works without Neovim’s native diff mode.

Changes:

  • Introduces diff1_inline layout plus an inline_diff renderer (unified + “overleaf” style) with cached hunks for ]c/[c navigation.
  • Extends layout/file-entry lifecycle to support non-window “owned files” and to clear layout-specific render state during layout conversion.
  • Updates config, keymaps, highlights, documentation, and adds functional test coverage for the new renderer/layout.

Reviewed changes

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

Show a summary per file
File Description
lua/diffview/scene/layouts/diff_1_inline.lua New diff1_inline layout that renders unified diffs into a single buffer via extmarks.
lua/diffview/scene/inline_diff.lua New inline diff renderer (unified + overleaf) with hunk caching and navigation helpers.
lua/diffview/config.lua Registers diff1_inline, adds view.inline.style validation, and adds layout-specific keymaps.
lua/diffview/actions.lua Adds next_inline_hunk/prev_inline_hunk and centralizes “jump to first change” logic.
lua/diffview/scene/layout.lua Adds teardown_render(), owned_files(), and get_file_for() to support inline layout lifecycle.
lua/diffview/scene/file_entry.lua Uses owned_files() for teardown/head updates/activation; calls teardown_render() before layout conversion; uses get_file_for() during conversion.
lua/diffview/hl.lua Adds DiffviewDiffDeleteInline highlight group for overleaf strikethrough deletions.
lua/diffview/scene/views/diff/listeners.lua Routes file_open_new behavior through actions.jump_to_first_change.
lua/diffview/scene/views/file_history/listeners.lua Same file_open_new jump-to-first-change centralization as diff view.
lua/diffview/tests/functional/layouts_spec.lua Extends layout symbol tests to cover Diff1Inline and teardown render behavior.
lua/diffview/tests/functional/inline_diff_spec.lua New functional test suite for inline renderer behavior, styles, and hunk navigation.
lua/diffview/tests/functional/file_entry_spec.lua Tests layout conversion teardown behavior and updates stubs to reflect owned_files().
lua/diffview/tests/functional/cycle_layouts_spec.lua Adds diff1_inline to known layouts and cycle-layout insertion expectations.
lua/diffview/tests/functional/config_options_spec.lua Adds validation tests for view.inline.style (default/overleaf/invalid/non-table).
doc/diffview_defaults.txt Documents defaults for diff1_inline and view.inline.style, plus keymaps.
doc/diffview.txt Adds user-facing docs for diff1_inline, view.inline, and inline-hunk actions.
TIPS.md Adds usage tips and configuration examples for inline and overleaf styles.

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

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 17 out of 17 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.

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 17 out of 17 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 lua/diffview/scene/layouts/diff_1_inline.lua
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 17 out of 17 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 lua/diffview/scene/inline_diff.lua Outdated
Comment thread lua/diffview/scene/inline_diff.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 17 out of 17 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
Single-window layout rendering unified diffs via extmark overlays.
Style configurable via `view.inline.style` (`"unified"` default;
`"overleaf"` for inline strikethrough deletions).
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 17 out of 17 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 a84c601 into main Apr 18, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the inline_diffs branch April 18, 2026 06:08
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.

[Feature Request] Add Inline (unified) diff view

2 participants