mirror of
https://github.com/friebetill/obsidian-file-diff.git
synced 2026-07-22 07:40:25 +00:00
Handle empty lines at the end
This commit is contained in:
parent
572cfbc790
commit
8f1f33d52d
1 changed files with 3 additions and 8 deletions
|
|
@ -64,8 +64,9 @@ export class DifferencesView extends ItemView {
|
|||
structuredPatch(
|
||||
this.file1.path,
|
||||
this.file2.path,
|
||||
this.file1Content,
|
||||
this.file2Content
|
||||
// Ignore empty lines at the end as they are difficult to handle
|
||||
this.file1Content.trimEnd(),
|
||||
this.file2Content.trimEnd()
|
||||
)
|
||||
)
|
||||
|
||||
|
|
@ -162,10 +163,4 @@ export class DifferencesView extends ItemView {
|
|||
}).open()
|
||||
})
|
||||
}
|
||||
|
||||
delay(ms: number): Promise<void> {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(resolve, ms)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue