Fix handling BOM when user Rejects apply_diff (#3960)

Related issue is #1483, related pull request is #1500 - but it looks like it missed the revert of proposed diff case
This commit is contained in:
avtc 2025-05-25 16:14:54 +03:00 committed by GitHub
parent 6ebc95d2a8
commit ad2ff932fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -278,7 +278,7 @@ export class DiffViewProvider {
updatedDocument.positionAt(updatedDocument.getText().length),
)
edit.replace(updatedDocument.uri, fullRange, this.originalContent ?? "")
edit.replace(updatedDocument.uri, fullRange, this.stripAllBOMs(this.originalContent ?? ""))
// Apply the edit and save, since contents shouldnt have changed
// this won't show in local history unless of course the user made