diff3 icon indicating copy to clipboard operation
diff3 copied to clipboard

Merge fails for large files

Open michael-bieniosek opened this issue 1 month ago • 2 comments

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.

michael-bieniosek avatar Jan 13 '25 19:01 michael-bieniosek