mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 10:44:21 +01:00
small fixes
This commit is contained in:
@@ -260,7 +260,12 @@ func replaceContent(filePath, oldString, newString string) (string, error) {
|
||||
}
|
||||
|
||||
newContent := oldContent[:index] + newString + oldContent[index+len(oldString):]
|
||||
diff := GenerateDiff(oldString, newContent)
|
||||
|
||||
startIndex := max(0, index-3)
|
||||
oldEndIndex := min(len(oldContent), index+len(oldString)+3)
|
||||
newEndIndex := min(len(newContent), index+len(newString)+3)
|
||||
|
||||
diff := GenerateDiff(oldContent[startIndex:oldEndIndex], newContent[startIndex:newEndIndex])
|
||||
|
||||
p := permission.Default.Request(
|
||||
permission.CreatePermissionRequest{
|
||||
|
||||
Reference in New Issue
Block a user