feat(view): add :DiffviewDiffFiles command#65
Merged
dlyongemallo merged 1 commit intomainfrom Mar 28, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for opening a Diffview tab that compares two arbitrary files on disk (not tied to a VCS repo) via a new :DiffviewDiffFiles user command.
Changes:
- Register
:DiffviewDiffFilescommand + completion, and route it throughdiffview.diff_files(). - Introduce a
NullAdapter/NullRevVCS adapter implementation and aFileDiffViewspecialized view for comparing two local file paths. - Add functional tests and update docs/README/TIPS to document the new command.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| plugin/diffview.lua | Registers the new :DiffviewDiffFiles user command. |
| lua/diffview/init.lua | Adds diff_files() entrypoint + command-line completion handler. |
| lua/diffview/lib.lua | Implements lib.diffview_diff_files() that validates paths and constructs a FileDiffView. |
| lua/diffview/scene/views/diff/file_diff_view.lua | New view type that populates a single file entry comparing two local files. |
| lua/diffview/vcs/adapters/null/init.lua | Adds a “null” adapter used for non-repo diffs. |
| lua/diffview/vcs/adapters/null/rev.lua | Adds a corresponding NullRev implementation. |
| lua/diffview/tests/functional/null_adapter_spec.lua | Functional coverage for NullAdapter / NullRev. |
| lua/diffview/tests/functional/file_diff_view_spec.lua | Functional coverage for FileDiffView + lib.diffview_diff_files(). |
| doc/diffview.txt | Documents :DiffviewDiffFiles. |
| TIPS.md | Adds a usage tip and shell function example. |
| README.md | Mentions the new command in usage and lazy-loading examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
d408c60 to
d70c8e6
Compare
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.