We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 066c0e6 commit e614d50Copy full SHA for e614d50
diffmatchpatch/diff.go
@@ -739,8 +739,8 @@ func (dmp *DiffMatchPatch) DiffCleanupSemantic(diffs []Diff) []Diff {
739
pointer++
740
}
741
} else {
742
- if float64(overlapLength2) >= float64(len(deletion))/2 ||
743
- float64(overlapLength2) >= float64(len(insertion))/2 {
+ if float64(overlapLength2) >= float64(len([]rune(deletion)))/2 ||
+ float64(overlapLength2) >= float64(len([]rune(insertion)))/2 {
744
// Reverse overlap found. Insert an equality and swap and trim the surrounding edits.
745
overlap := Diff{DiffEqual, deletion[:overlapLength2]}
746
diffs = splice(diffs, pointer, 0, overlap)
0 commit comments