mirror of
https://github.com/friebetill/obsidian-file-diff.git
synced 2026-07-22 07:40:25 +00:00
Fix bug when file 2 has multiple lines
This commit is contained in:
parent
56b8e2d7b0
commit
c3b005e909
1 changed files with 8 additions and 2 deletions
|
|
@ -83,8 +83,14 @@ export class DifferencesView extends ItemView {
|
|||
this.file2Lines = this.file2Content.split('\n')
|
||||
|
||||
this.lineCount = Math.max(
|
||||
this.file1Lines.length,
|
||||
this.file2Lines.length
|
||||
this.file1Lines.length -
|
||||
this.fileDifferences.differences
|
||||
.map((d) => d.file1Lines.length)
|
||||
.reduce((a, b) => a + b, 0),
|
||||
this.file2Lines.length -
|
||||
this.fileDifferences.differences
|
||||
.map((d) => d.file2Lines.length)
|
||||
.reduce((a, b) => a + b, 0)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue