fix: Diff Edit Failed

This commit is contained in:
vivek-kothandapani 2025-01-28 17:57:51 -05:00
parent fc5d0bdb5a
commit 907ad48371

View file

@ -1602,6 +1602,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,