Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unified diff #147

Open
savissimo opened this issue Jan 16, 2025 · 2 comments
Open

Unified diff #147

savissimo opened this issue Jan 16, 2025 · 2 comments

Comments

@savissimo
Copy link

Hello! Is there a way to get a unified diff with this library?

@kingcean
Copy link
Contributor

var diff = InlineDiffBuilder.Diff(before, after);
foreach (var line in diff.Lines)
{
    // line.Type and line.Text
}

If you are developing a WASDK (WinUI 3) app, you can insert following.

<diffplex:DiffTextView x:Name="DiffView" IsUnifiedView="True" />
DiffView.SetText(before, after);

@savissimo
Copy link
Author

So you confirm that there is not a single method to get the unified diff as a string, but I have to iterate over the DiffPaneModel and produce the diff myself?

Would you mind me contributing a method to do that? I may need support to check the conformity to the unified diff standard format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants