Wilfred / difftastic

a structural diff that understands syntax 🟥🟩
https://difftastic.wilfred.me.uk/
MIT License
21.04k stars 345 forks source link

Better support for multiline strings #372

Open chshersh opened 2 years ago

chshersh commented 2 years ago

First of all, thanks a lot for creating this amazing tool! 🎉 I use it daily and it helps me a lot 🤗

While using the issue, I've noticed one potential improvement. Currently, when I edit a single line in a multiline YAML code block, I see the diff between two YAML values as the fully new string instead of detailed highlights in each string (as shown on the screenshot below)

image

I would be truly wonderful if difftastic could produce a more granular diff in this case! 🙏🏻

Possibly related:

Additional information:

anka-213 commented 2 years ago

I wonder if it would be possible for difftastic to detect the nested language in these cases, to get full featured diffs even inside strings? But even a simple linewise diff would be an improvement of the current mode of treating strings as atomic.

Ramblurr commented 1 year ago

With the merging of https://github.com/Wilfred/difftastic/commit/9133918dd40d7e55e605934994b87807728b201d this should be possible now right?

I deal with lots of yaml with long multiline strings, and this feature would be really really helpful:

image