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

DiffPrettyText does does not colour all diffs with newlines #138

Open
michaelcheah opened this issue Mar 24, 2023 · 0 comments
Open

DiffPrettyText does does not colour all diffs with newlines #138

michaelcheah opened this issue Mar 24, 2023 · 0 comments

Comments

@michaelcheah
Copy link

Using the following example:

dmp := New()
diffs := dmp.DiffMain("a\nb\nc\ndef\ni", "a\ndef\ng\nh\ni", false)

Produces the following diffs:

diff2 := []Diff{
	{Type:DiffEqual, Text:"a\n"}, 
	{Type:DiffDelete, Text:"b\nc\n"}, 
	{Type:DiffEqual, Text:"def"}, 
	{Type:DiffInsert, Text:"\ng\nh"}, 
	{Type:DiffEqual, Text:"\ni"},
}

Pretty printing to stdout

fmt.Println(dmp.DiffPrettyText(diffs))

Produces the following stdout
image

However, I expected:
image

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

1 participant