diff --git a/app/utils/diff.ts b/app/utils/diff.ts index 25cde26f..d5fc6378 100644 --- a/app/utils/diff.ts +++ b/app/utils/diff.ts @@ -35,13 +35,8 @@ export function computeFileModifications(files: FileMap, modifiedFiles: Map file.content.length) { - // if there are lots of changes we simply grab the current file content since it's smaller than the diff - modifications[filePath] = { type: 'file', content: file.content }; - } else { - // otherwise we use the diff since it's smaller - modifications[filePath] = { type: 'diff', content: unifiedDiff }; - } + // always send a diff so that only the changed lines are rewritten + modifications[filePath] = { type: 'diff', content: unifiedDiff }; } if (!hasModifiedFiles) { @@ -59,7 +54,8 @@ export function computeFileModifications(files: FileMap, modifiedFiles: Map