feat: add vscode-diff.nvim as alternative diff viewer#1883
feat: add vscode-diff.nvim as alternative diff viewer#1883sotte wants to merge 3 commits intoNeogitOrg:masterfrom
Conversation
Add support for vscode-diff.nvim alongside diffview.nvim for viewing diffs. Users can explicitly choose via the new `diff_viewer` config option, or let Neogit auto-detect (diffview first, then vscode-diff). Why: - Provides choice for users who prefer vscode-diff's interface - Maintains backwards compatibility (diffview remains default) - Auto-detection means zero config for most users Implementation: - New `diff_viewer` config option: "diffview", "vscode_diff", or nil - New integration module at integrations/vscode-diff.lua with same interface as diffview (M.open with section_name, item_name, opts) - get_diff_viewer() helper handles explicit choice vs auto-detection - Diff popup and status buffer conflict resolution dispatch to the configured viewer - on_close callback for auto-staging after conflict resolution works with both viewers using the same BufEnter autocmd pattern
628594e to
8e18234
Compare
|
YES! YES! YES! |
|
It would be great to see this merged. |
|
This is really good. I saw the author of the vscode-diff released a newer version of the same project. It would be a good idea to migrate the support to V2. Thanks again for the work! |
|
@CKolkey already switched to the new version/fork. Everybody, please test this. Any feedback is welcome. |
|
Some commits when I diff (double tap d in NeogitStatus view) result in the left file not loading text and sometimes also getting an error saying "Invalid codediff URL". See it happen on a single-file commit and 5-file commit. Seems to be consistent for specific commits for some reason, both in stashes and the short commit list. Others work perfectly. I can't spot a pattern for this. |
|
Thanks for the feedback! My pr was based on the next branch. I assume some things have changed since the plug-in was moved into a new repo and next was merged. I have a few minutes to investigate today. |
|
When is merge expected? |
This is a draft implementation against the next branch of vscode-diff.nvim.
Note that I'm not using all the features of diffview and therefore vscode-diff.nvim, so the implementation is not going to be 100% correct :)
I think we should wait till next is merged before proceeding with this. But it gets the discussion started.
Add support for vscode-diff.nvim alongside diffview.nvim for viewing diffs. Users can explicitly choose via the new
diff_viewerconfig option, or let Neogit auto-detect (diffview first, then vscode-diff).Why:
Implementation:
diff_viewerconfig option: "diffview", "vscode_diff", or nil