softwaremill/diffx

Additional/Missing String rendering look inverted (Iterable/multiline String/...)

Closed this issue · 1 comments

Hi, I use the diffx-specs2 integration in my project, with great satisfaction and I now plan to use diffx-core to generate a change list for my users. But I noticed a difference when I used the String rendering, which looks inverted for Iterable and multiline String

Diff.compare("abc", "abc000").show // renders "-abc -> +abc000" which is OK
Diff.compare("abc", "abc\n000").show // renders "abc -000" although 000 is added to the right
Diff.compare(Seq("abc", "def"), Seq("abc")).show // renders List(0: abc, 1: +def) although an element is removed

It looks like showIntended should be inverted for DiffResultMissing and DiffResultAdditional, or did I miss something ? I'm willing to provide a PR if needed. Thanks !

Hi,

Yes, it seems that you are right.

Btw interesting colorConfig ;)