From ad2ff932fa6eae204c1b0cb54e091c623d852f14 Mon Sep 17 00:00:00 2001 From: avtc Date: Sun, 25 May 2025 16:14:54 +0300 Subject: [PATCH] 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 --- src/integrations/editor/DiffViewProvider.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/integrations/editor/DiffViewProvider.ts b/src/integrations/editor/DiffViewProvider.ts index dc812eab6d..adc19ff014 100644 --- a/src/integrations/editor/DiffViewProvider.ts +++ b/src/integrations/editor/DiffViewProvider.ts @@ -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