Handle empty lines at the end

This commit is contained in:
friebetill 2023-02-04 12:37:33 +08:00
parent 572cfbc790
commit 8f1f33d52d

View file

@ -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)
})
}
}