Skip to content

Commit 868f4cd

Browse files
authored
Merge pull request #120 from RooVetGit/prioritize_search_replace_exact_match
More diff fixes and a couple other things
2 parents 130c5ff + 2447468 commit 868f4cd

File tree

12 files changed

+740
-91
lines changed

12 files changed

+740
-91
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Roo Cline Changelog
22

3+
## [2.2.8]
4+
5+
- More work on diff editing (better matching, indentation, logging)
6+
37
## [2.2.7]
48

59
- More fixes to search/replace diffs

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# Roo-Cline
22

3-
A fork of Cline, an autonomous coding agent, optimized for speed and flexibility.
4-
- Auto-approval capabilities for commands, write, and browser operations
5-
- Support for .clinerules per-project custom instructions
6-
- Ability to run side-by-side with Cline
7-
- Unit test coverage (written almost entirely by Roo Cline!)
8-
- Support for playing sound effects
9-
- Support for OpenRouter compression
10-
- Support for copying prompts from the history screen
11-
- Support for editing through diffs / handling truncated full-file edits
12-
- Support for newer Gemini models (gemini-exp-1206 and gemini-2.0-flash-exp)
13-
- Support for dragging and dropping images into chats
14-
- Support for auto-approving MCP tools
15-
- Support for enabling/disabling MCP servers
3+
A fork of Cline, an autonomous coding agent, tweaked for more speed and flexibility. It’s been mainly writing itself recently, with a light touch of human guidance here and there.
4+
5+
## Features
6+
7+
- Automatically approve commands, browsing, file writing, and MCP tools
8+
- Faster, more targeted edits via diffs (even on big files)
9+
- Detects and fixes missing code chunks
10+
- `.clinerules` for project-specific instructions
11+
- Drag and drop images into chats
12+
- Sound effects for feedback
13+
- Quick prompt copying from history
14+
- OpenRouter compression support
15+
- Support for newer Gemini models (gemini-exp-1206, gemini-2.0-flash-exp)
16+
- Runs alongside the original Cline
1617

1718
## Disclaimer
1819

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Roo Cline",
44
"description": "A fork of Cline, an autonomous coding agent, with some added experimental configuration and automation features.",
55
"publisher": "RooVeterinaryInc",
6-
"version": "2.2.7",
6+
"version": "2.2.8",
77
"icon": "assets/icons/rocket.png",
88
"galleryBanner": {
99
"color": "#617A91",

src/core/Cline.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,20 +1237,25 @@ export class Cline {
12371237
const originalContent = await fs.readFile(absolutePath, "utf-8")
12381238

12391239
// Apply the diff to the original content
1240-
let newContent = this.diffStrategy?.applyDiff(originalContent, diffContent) ?? false
1241-
if (newContent === false) {
1240+
const diffResult = this.diffStrategy?.applyDiff(originalContent, diffContent) ?? {
1241+
success: false,
1242+
error: "No diff strategy available"
1243+
}
1244+
if (!diffResult.success) {
12421245
this.consecutiveMistakeCount++
1243-
await this.say("error", `Unable to apply diff to file - contents are out of sync: ${absolutePath}`)
1244-
pushToolResult(`Error applying diff to file: ${absolutePath} - contents are out of sync. Try re-reading the relevant lines of the file and applying the diff again.`)
1246+
const errorDetails = diffResult.details ? `\n\nDetails:\n${JSON.stringify(diffResult.details, null, 2)}` : ''
1247+
await this.say("error", `Unable to apply diff to file: ${absolutePath}\n${diffResult.error}${errorDetails}`)
1248+
pushToolResult(`Error applying diff to file: ${absolutePath}\n${diffResult.error}${errorDetails}`)
12451249
break
12461250
}
1251+
const newContent = diffResult.content
12471252

12481253
this.consecutiveMistakeCount = 0
12491254

12501255
// Show diff view before asking for approval
12511256
this.diffViewProvider.editType = "modify"
12521257
await this.diffViewProvider.open(relPath);
1253-
await this.diffViewProvider.update(newContent, true);
1258+
await this.diffViewProvider.update(diffResult.content, true);
12541259
await this.diffViewProvider.scrollToFirstDiff();
12551260

12561261
const completeMessage = JSON.stringify({

0 commit comments

Comments
 (0)