Skip to content

Commit ecede73

Browse files
committed
Fix typo
1 parent fa8890a commit ecede73

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/integrations/editor/DiffViewProvider.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ export class DiffViewProvider {
8585
const document = diffEditor?.document;
8686

8787
if (diffEditor && document) {
88-
const edit = new vscode.WorkspaceEdit();
88+
// Preserve empty last line if original content had one
89+
const hasEmptyLastLine = this.originalContent?.endsWith("\n")
90+
if (hasEmptyLastLine && !accumulatedContent.endsWith("\n")) {
91+
accumulatedContent += "\n"
92+
}
93+
8994
// Replace entire document
95+
const edit = new vscode.WorkspaceEdit();
9096
edit.replace(
9197
document.uri,
9298
new vscode.Range(0, 0, document.lineCount, 0),
9399
accumulatedContent
94100
);
95-
96-
// Preserve empty last line if original content had one
97-
const hasEmptyLastLine = this.originalContent?.endsWith("\n")
98-
if (hasEmptyLastLine && !accumulatedContent.endsWith("\n")) {
99-
accumulatedContent += "\n"
100-
}
101101

102102
await vscode.workspace.applyEdit(edit);
103103
}

0 commit comments

Comments
 (0)