From 26871d2553c5496994cd315200c5e293eb80dadf Mon Sep 17 00:00:00 2001 From: Shimada666 <649940882@qq.com> Date: Tue, 15 Aug 2023 11:32:29 +0800 Subject: [PATCH] fix: fixed diff problem in split mode --- src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils.ts b/src/utils.ts index fbdb0ac..708963e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -47,7 +47,7 @@ function diffLines(prev: string, current: string) { dmp.diff_charsToLines_(diffs, lineArray) return diffs.map((x) => { const [type, text] = x - const count = text.trim().split('\n').length + const count = text.replace(/\n$/, '').split('\n').length const change: Diff.Change = { count, value: text,