feat(layout): support do (obtain diff hunk) keymap in diff1_inline layout#123
Merged
dlyongemallo merged 1 commit intomainfrom Apr 18, 2026
Merged
feat(layout): support do (obtain diff hunk) keymap in diff1_inline layout#123dlyongemallo merged 1 commit intomainfrom
do (obtain diff hunk) keymap in diff1_inline layout#123dlyongemallo merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for obtaining (“diffget”) the old-side hunk in the diff1_inline (unified inline extmark) layout, where native Vim diff mode is disabled.
Changes:
- Implement
Diff1Inline:diffget(first, last)to splice old-side content into the live buffer based on cachedvim.diffhunks. - Route
actions.diffget()to the inline-layout implementation when the current layout isDiff1Inline, including visual-range support. - Add
inline_diff.get_hunks(bufnr)accessor, wire up thedokeymap fordiff1_inline, and add functional tests forDiff1Inline:diffget.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| lua/diffview/scene/layouts/diff_1_inline.lua | Adds the inline-layout diffget splice implementation operating on cached hunks/old lines. |
| lua/diffview/actions.lua | Extends actions.diffget to special-case Diff1Inline and apply hunks over a cursor/visual range. |
| lua/diffview/scene/inline_diff.lua | Exposes cached hunk list via get_hunks(bufnr) for consumers like Diff1Inline:diffget. |
| lua/diffview/config.lua | Adds do mapping for diff1_inline and updates comment about native diff limitations. |
| lua/diffview/tests/functional/layouts_spec.lua | Adds functional coverage for Diff1Inline:diffget across add/change/delete and range cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
2a92a20 to
221e690
Compare
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.