wandersoncferreira / code-review

Code Reviews in Emacs
https://wandersoncferreira.github.io/code-review/
GNU General Public License v3.0
462 stars 49 forks source link

Integration with delta for syntax highlighting #201

Open mplanchard opened 2 years ago

mplanchard commented 2 years ago

Is your feature request related to a problem? Please describe. It can be difficult to parse huge diffs without syntax highlighting

Describe the solution you'd like Integration with delta in order to get syntax-highlighted diffs, like magit-delta does, would be awesome.

Describe alternatives you've considered I don't know of any other ways of getting syntax highlighting in diffs.

Additional context I wanted to pop this open as a feature request, because it's one of the only things I miss when using code-review. I've tried just enabling magit-delta-mode in a code-review buffer, but unsurprisingly that doesn't work.

I'm no emacs lisp expert, but I would be happy to spend some time on this if somebody could point me in the right direction.

isamert commented 3 months ago

I applied the following diff to code-review-section.el and this makes magit-delta work.

@@ -1625,2 +1625,5 @@ If you want to display a minibuffer MSG in the end."
-                  (magit-wash-sequence
-                   (apply-partially #'magit-diff-wash-diff ())))))
+                  (save-restriction
+                    (narrow-to-region (point) (point-max))
+                    (run-hooks 'magit-diff-wash-diffs-hook)
+                    (magit-wash-sequence
+                     (apply-partially #'magit-diff-wash-diff ()))))))