mirror of
https://github.com/friebetill/obsidian-file-diff.git
synced 2026-07-22 07:40:25 +00:00
Show all lines in diff
This fixes a bug where the line count was not caculated correctly.
This commit is contained in:
parent
add2cb75b4
commit
428d9b4682
1 changed files with 8 additions and 6 deletions
|
|
@ -89,13 +89,15 @@ export class DifferencesView extends ItemView {
|
|||
|
||||
this.lineCount = Math.max(
|
||||
this.file1Lines.length -
|
||||
this.fileDifferences.differences
|
||||
.map((d) => d.file1Lines.length)
|
||||
.reduce((a, b) => a + b, 0),
|
||||
// Count each difference as one line
|
||||
this.fileDifferences.differences.filter(
|
||||
(d) => d.file1Lines.length > 0
|
||||
).length,
|
||||
this.file2Lines.length -
|
||||
this.fileDifferences.differences
|
||||
.map((d) => d.file2Lines.length)
|
||||
.reduce((a, b) => a + b, 0)
|
||||
// Count each difference as one line
|
||||
this.fileDifferences.differences.filter(
|
||||
(d) => d.file2Lines.length > 0
|
||||
).length
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue