mmanela / diffplex

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

Add word-level diffs for WPF controls. #54

Closed kingcean closed 4 years ago

kingcean commented 4 years ago

Controls DiffViewer, InternalLinesViewer and SideBySideDiffViewer support sub-piece diffs by default now.

Fix #53 issue.

It is dependent on that the diffs result DiffPaneModel computed from diff builder (such as SideBySideDiffBuilder) contains sub-pieces information.

Following is an example.

<diffplex:DiffViewer x:Name="DiffView" />
DiffView.OldText = oldText;
DiffView.NewText = newText;

Diff sample

And following is another example.

<diffplex:SideBySideDiffViewer x:Name="DiffView" />
DiffView.SetDiffModel(OldText, NewText);

Note: It will be disabled when the text is too large (more than 3K lines) because of performance.

This PR also contains the changes of performance improvement to async render result for side-by-side mode.

kingcean commented 4 years ago

Need upload DiffPlex package to NuGet before DiffPlex.Wpf package because the new version of the former is the dependency of the latter since #52. @mmanela

mmanela commented 4 years ago

Done and published

kingcean commented 4 years ago

@mmanela Sounds NuGet package DiffPlex 1.6.0 uploaded actually contains the assembly DiffPlex.dll 1.5.0, but we expect it includes 1.6.0. Maybe something wrong when build and generate DiffPlex package.

https://www.nuget.org/packages/DiffPlex/1.6.0

So it will build failed now if you have a project which installs the package DiffPlex.Wpf 1.1.0 because it cannot find the dependency DiffPlex.dll 1.6.0. You can have a test by installing it into a test project and checking the version of the dll referenced.

How to fix

  1. Update the package version of DiffPlex to 1.6.1 because NuGet disallow to override the existing one.
  2. Build and generate the NuGet package DiffPlex.1.6.1.nupkg and ensure it includes DiffPlex.dll 1.6.1 assembly. Then upload to NuGet.
  3. Update the package version of DiffPlex.Wpf to 1.1.1.
  4. Build and generate the NuGet package DiffPlex.Wpf.1.1.1.nupkg and upload to NuGet.
mmanela commented 4 years ago

I just published. Should be fixed. let me know

kingcean commented 4 years ago

@mmanela It works now.