go-diff icon indicating copy to clipboard operation
go-diff copied to clipboard

Diff, match and patch text in Go

Results 31 go-diff issues
Sort by recently updated
recently updated
newest added

The following code panics when using `PatchApply` ```go func main() { dmp := diffmatchpatch.New() patches, _ := dmp.PatchFromText("@@ -1,2 +1,3 @@\n %E2%98%9E \n+r\n") fmt.Println(dmp.PatchToText(patches)) s, _ := dmp.PatchApply(patches, "☞ 𝗢𝗥𝗗𝗘𝗥...

1. Restructure the pretty functions for more general pretty ways. 2. Add pretty function for markdown. 3. Diff's pretty result with both old and new pretty color.

I believe the fix for https://github.com/sergi/go-diff/issues/89 introduced regressions for files with `\r\n` line endings. This reproduces as of commit https://github.com/sergi/go-diff/commit/db1b095f5e7c905e196ff6bfd56189a41aa76309. The following repro program illustrates the issue. It compares two...

``` oldS := ` asd cvf ` newS := ` asd cvf ` chars1, chars2, lineSlice := dmp.DiffLinesToChars(oldS, newS) ``` DiffLinesToChars do not hash same line to same value that...

just like ![image](https://user-images.githubusercontent.com/12526901/112822934-2c36b900-90bb-11eb-9a9c-8ad972115fd2.png)

it would be helpful if whitespace was shown. It could be shown with a Coloured background. Newlines could be shown as `\n` (although only if it is changed?)

Hello! I'm working with some longer pattern values, the value I'm currently testing has len(pattern) = ~800. I noticed that the line here: https://github.com/sergi/go-diff/blob/v1.2.0/diffmatchpatch/match.go#L57 causes an overflow beyond the length...

I had tested your library. It works very well. However I see that basic functionality means "DiffPrettyText" works well in color console, but in windows command line is producing garbage....

At the moment it is only easy to output inline diff outputs but something like this https://github.com/sergi/go-diff/pull/67/files?diff=unified would be a nice addition for the output functions.

enhancement
Help Wanted

When diffing JSON, we have some json like: ``` { "del": "^2.2.0", "es6-symbol": "^3.1.1", "eslint": "^4.11.0", "eslint-config-enough": "0.2.5", } ``` If we compare to ``` { "del": "^2.2.0", "eslint": "^4.11.0",...