Closed ideasman42 closed 11 months ago
This may be of interest to @jdtsmith.
I'm not familiar with ansi-diff. Is the full diff header information preserved by it? If so, would it not make more sense for the hook to run prior to cleanup? Then you presumably wouldn't need to hack the --- +++ line display.
I'm not familiar with ansi-diff. Is the full diff header information preserved by it? If so, would it not make more sense for the hook to run prior to cleanup? Then you presumably wouldn't need to hack the --- +++ line display.
The issue would then be that vundo-diff
might attempt to cleanup content that was in a format that it didn't expect, although, in the case of diff-ansi
it would mean some parts of vundo-diff could be skipped (anything that sets highlighting for e.g.).
Right, the cleanup only "does what it can". Do the ---
/+++
lines stay intact?
The edits to ---
/ +++
are left in, it seems diff-ansi
, which I have configured to use delta
- works with the modifications.
Any overlays or text properties are lost though.
@ideasman42 if you can squash and rewrite the commit message, I can then merge it.
@ideasman42 if you can squash and rewrite the commit message, I can then merge it.
Done (some reviewers prefer to see the individual commits, then squish themselves).
Cool, thanks!
This PR adds a hook that runs after the vundo-diff buffer has been setup (created or re-initialized with new contents).
This can be useful for manipulating the diff buffer, for example, I'm currently using two hooks:
This hook uses the diff-ansi package for easier to read diffs:
This allows delta to be used for diff display, which supports side-by-side view, syntax-highlighting and character level difference display which I find easier to parse:
screenshot.webm
Note that I had to adjust the filename formatting for
delta
to syntax highlight properly, perhaps the diff filename formatting could be configurable eventually, that's outside the scope of this PR though.