-
-
Notifications
You must be signed in to change notification settings - Fork 304
feat: add vscode-diff.nvim as alternative diff viewer #1883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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. |
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