mmanela / diffplex

DiffPlex is Netstandard 1.0+ C# library to generate textual diffs.
Apache License 2.0
996 stars 183 forks source link

Issue when passing in an IDiffer to SideBySideDiffBuilder #71

Closed tolanj closed 3 years ago

tolanj commented 3 years ago

When using the overload to pass in an IDiffer to the SideBySide model ALL SubPieces appear on all changes. Cause appears to be:

public static SideBySideDiffModel Diff(IDiffer differ, string oldText, string newText, bool ignoreWhiteSpace = true, bool ignoreCase = false, IChunker lineChunker = null, IChunker wordChunker = null)

has lamda (ot, nt, op, np) =>
            {
                var r = differ.CreateDiffs(oldText, newText, false, false, wordChunker ?? WordChunker.Instance);
                BuildDiffPieces(r, op, np, null);
            }

Should be CreateDiffs(ot, nt ......