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 217d392 commit dbf098bCopy full SHA for dbf098b
diffmatchpatch/diff.go
@@ -1236,9 +1236,9 @@ func (dmp *DiffMatchPatch) DiffLevenshtein(diffs []Diff) int {
1236
for _, aDiff := range diffs {
1237
switch aDiff.Type {
1238
case DiffInsert:
1239
- insertions += len(aDiff.Text)
+ insertions += utf8.RuneCountInString(aDiff.Text)
1240
case DiffDelete:
1241
- deletions += len(aDiff.Text)
+ deletions += utf8.RuneCountInString(aDiff.Text)
1242
case DiffEqual:
1243
// A deletion and an insertion is one substitution.
1244
levenshtein += max(insertions, deletions)
0 commit comments