I realise this is a bit of an odd request, but here goes anyway:
Highlighting of diffs in (Neo)Vim is a counter-intuitive. When you have version A and B of a file and diff them, A will show the diff relative to B, while B shows the diff relative to A. In practise this means that e.g. a line removed by B shows up as an addition in A, while not showing up in B. Here's an example of that:

In addition, changes in B tend to highlighted using the DiffText highlight group. This can result in diffs largely looking similar highlight wise, making it difficult to see what actually changed.
For vim-fugitive I have a hack to fix this (see here). This basically uses winhl to overwrite highlight groups in the appropriate fugitive buffer. The result is something that looks like this:

Note how in the old version (left) deletions are shown in red, while additions in the new file (right) are in green. This is what you'd expect when looking at a diff, instead of the default Vim mess.
For diffview.nvim this doesn't work. Buffer names don't have predictable names I can use to inject my winhl rules. There are no hooks of any kind that I can tap into either. Which brings me to my request:
Would it be possible to somehow expose a hook that runs for old/new versions in a diff, or perhaps use specific buffer names (e.g. before: diffview/XXX.rb) for old/new versions? That would make it possible to fix the diff highlights.
I realise this is a bit of an odd request, but here goes anyway:
Highlighting of diffs in (Neo)Vim is a counter-intuitive. When you have version A and B of a file and diff them, A will show the diff relative to B, while B shows the diff relative to A. In practise this means that e.g. a line removed by B shows up as an addition in A, while not showing up in B. Here's an example of that:
In addition, changes in B tend to highlighted using the
DiffTexthighlight group. This can result in diffs largely looking similar highlight wise, making it difficult to see what actually changed.For vim-fugitive I have a hack to fix this (see here). This basically uses
winhlto overwrite highlight groups in the appropriate fugitive buffer. The result is something that looks like this:Note how in the old version (left) deletions are shown in red, while additions in the new file (right) are in green. This is what you'd expect when looking at a diff, instead of the default Vim mess.
For diffview.nvim this doesn't work. Buffer names don't have predictable names I can use to inject my
winhlrules. There are no hooks of any kind that I can tap into either. Which brings me to my request:Would it be possible to somehow expose a hook that runs for old/new versions in a diff, or perhaps use specific buffer names (e.g.
before: diffview/XXX.rb) for old/new versions? That would make it possible to fix the diff highlights.