Skip to content

Commit 26871d2

Browse files
committed
fix: fixed diff problem in split mode
1 parent 317ca9d commit 26871d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function diffLines(prev: string, current: string) {
4747
dmp.diff_charsToLines_(diffs, lineArray)
4848
return diffs.map((x) => {
4949
const [type, text] = x
50-
const count = text.trim().split('\n').length
50+
const count = text.replace(/\n$/, '').split('\n').length
5151
const change: Diff.Change = {
5252
count,
5353
value: text,

0 commit comments

Comments
 (0)