-
Notifications
You must be signed in to change notification settings - Fork 95
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
Support external tool for adding color and syntax highlighting to diffs #49
Comments
Hey! Happy you like the tool, I'm a user of Delta as well and find it great! :) I was experimenting with this and I like the idea! I also thought about the --color-only vs letting Delta do everything, while i liked the fact of showing side-by-side views in Gitu as well, it'd make it impossible to stage individual lines (in the future). Perhaps it could be configurable. The reason I worked on moving away from this implementation I think was due to:
This is what I encountered too, as Ratatui doesn't read ansi escape codes, though I found there's a lib for doing so. Anyway, I think this will fit right in as a configurable option (cli or the config-file)! Line 88 in ecd068f
|
Great! Yes, supporting side-by-side would be nice if it can be done in a way that doesn't get in the way of basic magit functionality like staging selected lines. But I'd be happy with delta-colored standard diffs initially. |
is this supported yet? |
Hi @altsem, gitu looks fantastic. Would it be possible to support using an external tool to add colors to diffs before display? I'm the author of https://github.com/dandavison/delta, and I'd love to be able to use gitu with colors supplied by delta. Delta works by taking diff format input on stdin, and writing the same diff to stdout with ANSI color escape sequences inserted. It has an option
--color-only
that guarantees not to make any structural alterations to the diff, other than adding colors (syntax highlighting and/or background colors). So the simplest implementation would be to allow users to configure an external binary that is passed the raw diff as text, just before gitu is ready to display it.(Incidentally, delta can be used in this way to add syntax highlighting and colors to emacs magit, but of course the implementation there is more complex because the ANSI color escapes produced by delta have to be translated to the way emacs represents colored text: https://github.com/dandavison/magit-delta.)
The text was updated successfully, but these errors were encountered: