diff3
diff3 copied to clipboard
Merge fails for large files
I was testing merging on a very large file (260k lines) and hit a panic here: https://github.com/nasdf/diff3/blob/main/diff3.go#L131
panic: runtime error: index out of range [157894] with length 155846
After a bit of inspection, I think the issue is that you're calling int(r) instead of diffmatchpatch.runeToInt(r), as DiffCharsToLines does it. From looking at code for runeToInt/intToRune it seems like this could happen with much smaller file size than 100k+ lines.