feat(layout): add diff1_inline unified diff view#120
Conversation
There was a problem hiding this comment.
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_inlinelayout plus aninline_diffrenderer (unified + “overleaf” style) with cached hunks for]c/[cnavigation. - 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.
f4a2af5 to
d8d4227
Compare
There was a problem hiding this comment.
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.
021a9b8 to
df3b910
Compare
There was a problem hiding this comment.
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.
df3b910 to
10429a5
Compare
There was a problem hiding this comment.
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.
10429a5 to
0851b78
Compare
There was a problem hiding this comment.
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.
Single-window layout rendering unified diffs via extmark overlays. Style configurable via `view.inline.style` (`"unified"` default; `"overleaf"` for inline strikethrough deletions).
0851b78 to
cb30263
Compare
There was a problem hiding this comment.
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.
Single-window layout rendering unified diffs via extmark overlays. Style configurable via
view.inline.style("unified"default;"overleaf"for inline strikethrough deletions).]c/[cnavigate hunks.Char-level diff helpers adapted from @tienlonghungson's sample in #109, which was modified from YouSame2/inlinediff-nvim.
Closes #108 and #109.