sergi / go-diff

Diff, match and patch text in Go
MIT License
1.81k stars 207 forks source link

fix: use indivisible line hashes #141

Closed schroederc closed 4 months ago

schroederc commented 1 year ago

Revert implementation of diffLines to use runes to fix #140. In order to not regress #89, skip invalid utf8 runes when munging lines. We also panic if we reach the upper limit.

I'm sending this out with the limitation in place and commented because I think having a limit is preferable to silently returning incorrect results as in #140. However, the most preferable solution would be something as described in https://github.com/sergi/go-diff/issues/89#issuecomment-591376325.

howdareyou69 commented 1 year ago

Very invisible