difftastic icon indicating copy to clipboard operation
difftastic copied to clipboard

Better support for multiline strings

Open chshersh opened this issue 3 years ago • 3 comments

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:

  • https://github.com/Wilfred/difftastic/issues/178

Additional information:

  • OS: Ubuntu 22.04
  • Difftastic version: 0.35.0

chshersh avatar Sep 13 '22 13:09 chshersh

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.

anka-213 avatar Oct 29 '22 11:10 anka-213

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

Ramblurr avatar May 26 '23 07:05 Ramblurr