Merge pull request #1524 from vivek-kothandapani/diff-edit-failed

fix: Diff Edit Failed
This commit is contained in:
akfoster authored and GitHub committed 2025-01-29 11:00:54 -08:00
commit 754a075ac0
2 files changed
+10

No files matched your search

@@ -0,0 +1,3 @@
kind: Fixed
body: Fix for the "Diff Edit Failed" / "replace_in_file" defects - #1010 #1511 #953
time: 2025-01-29T09:51:07.5008655-05:00
+7
View File
@@ -1595,6 +1595,13 @@ export class Cline {
diff = fixModelHtmlEscaping(diff)
diff = removeInvalidChars(diff)
}
// open the editor if not done already. This is to fix diff error when model provides correct search-replace text but Cline throws error
// because file is not open.
if (!this.diffViewProvider.isEditing) {
await this.diffViewProvider.open(relPath)
}
try {
newContent = await constructNewFileContent(
diff,