Skip to content

Conversation

@sotte
Copy link
Contributor

@sotte sotte commented Dec 26, 2025

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_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

sotte and others added 2 commits December 25, 2025 13:48
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
@CKolkey CKolkey force-pushed the support-vscode-diff branch from 628594e to 8e18234 Compare January 9, 2026 09:27
@DanRioDev
Copy link

YES! YES! YES!

@georgeharker
Copy link

It would be great to see this merged.

@IanLiuTW
Copy link

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!

@sotte
Copy link
Contributor Author

sotte commented Jan 13, 2026

@CKolkey already switched to the new version/fork.

Everybody, please test this. Any feedback is welcome.

@Knaifhogg
Copy link

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.

@sotte
Copy link
Contributor Author

sotte commented Jan 18, 2026

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.

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.

6 participants