mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
fix diffview for search-and-replace tool and insert tool
This commit is contained in:
@@ -1573,11 +1573,7 @@ export class Cline {
|
|||||||
await delay(200)
|
await delay(200)
|
||||||
}
|
}
|
||||||
|
|
||||||
const diff = formatResponse.createPrettyPatch(
|
const diff = formatResponse.createPrettyPatch(relPath, fileContent, updatedContent)
|
||||||
relPath,
|
|
||||||
this.diffViewProvider.originalContent,
|
|
||||||
updatedContent,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!diff) {
|
if (!diff) {
|
||||||
pushToolResult(`No changes needed for '${relPath}'`)
|
pushToolResult(`No changes needed for '${relPath}'`)
|
||||||
@@ -1707,6 +1703,8 @@ export class Cline {
|
|||||||
|
|
||||||
// Read the original file content
|
// Read the original file content
|
||||||
const fileContent = await fs.readFile(absolutePath, "utf-8")
|
const fileContent = await fs.readFile(absolutePath, "utf-8")
|
||||||
|
this.diffViewProvider.editType = "modify"
|
||||||
|
this.diffViewProvider.originalContent = fileContent
|
||||||
let lines = fileContent.split("\n")
|
let lines = fileContent.split("\n")
|
||||||
|
|
||||||
for (const op of parsedOperations) {
|
for (const op of parsedOperations) {
|
||||||
@@ -1745,11 +1743,7 @@ export class Cline {
|
|||||||
this.consecutiveMistakeCount = 0
|
this.consecutiveMistakeCount = 0
|
||||||
|
|
||||||
// Show diff preview
|
// Show diff preview
|
||||||
const diff = formatResponse.createPrettyPatch(
|
const diff = formatResponse.createPrettyPatch(relPath, fileContent, newContent)
|
||||||
relPath,
|
|
||||||
this.diffViewProvider.originalContent,
|
|
||||||
newContent,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (!diff) {
|
if (!diff) {
|
||||||
pushToolResult(`No changes needed for '${relPath}'`)
|
pushToolResult(`No changes needed for '${relPath}'`)
|
||||||
|
|||||||
Reference in New Issue
Block a user