go-diff
go-diff copied to clipboard
DiffPrettyText does does not colour all diffs with newlines
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
However, I expected: