Skip to content

feat(layout): support do (obtain diff hunk) keymap in diff1_inline layout#123

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

feat(layout): support do (obtain diff hunk) keymap in diff1_inline layout#123
dlyongemallo merged 1 commit intomainfrom
inline_diffs

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 18, 2026 08:58
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 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 cached vim.diff hunks.
  • Route actions.diffget() to the inline-layout implementation when the current layout is Diff1Inline, including visual-range support.
  • Add inline_diff.get_hunks(bufnr) accessor, wire up the do keymap for diff1_inline, and add functional tests for Diff1Inline: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.

Comment thread lua/diffview/actions.lua Outdated
Comment thread lua/diffview/config.lua
Comment thread lua/diffview/scene/layouts/diff_1_inline.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 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.

@dlyongemallo dlyongemallo merged commit 7df789b into main Apr 18, 2026
6 checks passed
@dlyongemallo dlyongemallo deleted the inline_diffs branch April 18, 2026 10:04
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