You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/opencode/src/tool/edit.ts
+14-7Lines changed: 14 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,7 @@ import * as path from "path"
3
3
import{Tool}from"./tool"
4
4
import{FileTimes}from"./util/file-times"
5
5
import{LSP}from"../lsp"
6
+
import{diffLines}from"diff"
6
7
7
8
constDESCRIPTION=`Edits files by replacing text, creating new files, or deleting content. For moving or renaming files, use the Bash tool with the 'mv' command instead. For larger file edits, use the FileWrite tool to overwrite files.
`File ${filePath} has been modified since it was last read.\nLast modification: ${read.toISOString()}\nLast read: ${stats.mtime.toISOString()}\n\nPlease read the file again before modifying it.`,
92
96
)
93
97
94
-
constcontent=awaitfile.text()
95
-
constindex=content.indexOf(params.oldString)
98
+
contentOld=awaitfile.text()
99
+
constindex=contentOld.indexOf(params.oldString)
96
100
if(index===-1)
97
101
thrownewError(
98
102
`oldString not found in file. Make sure it matches exactly, including whitespace and line breaks`,
0 commit comments