From 1579375550f505ddbbb9b10998f9824fbb64b291 Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Sat, 2 Aug 2025 18:52:16 -0700 Subject: [PATCH] fix: remove the first two lines generated by createDiff --- core/nextEdit/templating/mercuryCoderNextEdit.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/nextEdit/templating/mercuryCoderNextEdit.ts b/core/nextEdit/templating/mercuryCoderNextEdit.ts index 616700b17..d87923969 100644 --- a/core/nextEdit/templating/mercuryCoderNextEdit.ts +++ b/core/nextEdit/templating/mercuryCoderNextEdit.ts @@ -48,7 +48,10 @@ export function currentFileContentBlock( export function editHistoryBlock( editDiffHistory: string, // could be a singe large unified diff ) { - return editDiffHistory; + // diffHistory is made from createDiff. + // This uses createPatch from npm diff library, which includes an index line and a separator. + // We get rid of these first two lines. + return editDiffHistory.split("\n").slice(2).join("\n"); } function mercuryNextEditTemplateBuilder(