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
Highlight diffs when there is unrecognised initial content #121
Comments
I suppose the crux here is to extend |
I was hoping to be able to more flexible and not care what the initial content is until we get to recognizable content. If you would like to, any thoughts you have on #123 would be appreciated! |
Yeah this sounds really useful, it means we could use delta in places where there is arbitrary text before the diff. Would this also handle unrecognised text after the diff as well, or is that not possible? |
Yes, unrecognised text after the diff is printed out. However, currently, the state machine will still be in HUNK mode (see screenshot below, in particular the way that the initial junk is not syntax highlighted but when it occurs further down after a hunk it is.) This can be improved: basically, when in a diff hunk, the first character in each line must be one of
|
cc @m-lima @gibfahn Currently, if delta doesn't recognize the type of diff from the first line, it gives up on parsing. I'm aware of two situations where this is too strict:
Magit makes calls like
git show -p --cc --format= --numstat --stat
. This results in thenumstat
andstat
output appearing before the diff, and the diff is not highlighted as a result. (I'm making it possible to usedelta
as a diff rendering plugin for magit.)In Support
git stash show --stat --patch
#100 delta does not rendergit stash show --stat --patch
correctly for the same reason.The text was updated successfully, but these errors were encountered: