Only calc diff to scroll to if fileExists

This commit is contained in:
Saoud Rizwan
2024-09-10 21:48:21 -04:00
parent 74ac4a69aa
commit 1958cb1536

View File

@@ -848,6 +848,7 @@ export class ClaudeDev {
await vscode.workspace.applyEdit(edit) // has the added benefit of maintaing the file's original EOLs
// Find the first range where the content differs and scroll to it
if (fileExists) {
const diffResult = diff.diffLines(originalContent, newContent)
for (let i = 0, lineCount = 0; i < diffResult.length; i++) {
const part = diffResult[i]
@@ -863,6 +864,7 @@ export class ClaudeDev {
}
lineCount += part.count || 0
}
}
// remove cursor from the document
await vscode.commands.executeCommand("workbench.action.focusSideBar")