Compare commits

...
Author SHA1 Message Date
Dennis Bartlett 0c377c7d0a Revert "Added option for skipping diff animation. Useful when diff animation …"
This reverts commit 12f16a47e3.
2025-03-19 20:11:24 -07:00
5 changed files with 15 additions and 53 deletions
-5
View File
@@ -1,5 +0,0 @@
---
"claude-dev": minor
---
Added option for skipping diff animation. Useful when diff animation is slow.
-8
View File
@@ -137,14 +137,6 @@ For example, when working with a local web server, you can use 'Restore Workspac
<img width="2000" height="0" src="https://github.com/user-attachments/assets/ee14e6f7-20b8-4391-9091-8e8e25561929"><br>
## Settings
Cline provides several settings to customize its behavior:
### Editor Settings
- `cline.editor.skipDiffAnimation`: Disable the animated diff view when Cline makes changes to files. This can significantly speed up file modifications, especially when working with remote repositories. Default: `false`
## Contributing
To contribute to the project, start with our [Contributing Guide](CONTRIBUTING.md) to learn the basics. You can also join our [Discord](https://discord.gg/cline) to chat with other contributors in the `#contributors` channel. If you're looking for full-time work, check out our open positions on our [careers page](https://cline.bot/join-us)!
-5
View File
@@ -182,11 +182,6 @@
"default": null,
"description": "Path to Chrome executable for browser use functionality. If not set, the extension will attempt to find or download it automatically."
},
"cline.editor.skipDiffAnimation": {
"type": "boolean",
"default": false,
"description": "Skip the animation when applying diffs in the editor. Useful for faster updates, especially with remote repositories."
},
"cline.preferredLanguage": {
"type": "string",
"enum": [
+15 -28
View File
@@ -14,7 +14,6 @@ export class DiffViewProvider {
editType?: "create" | "modify"
isEditing = false
originalContent: string | undefined
skipAnimation = false
private createdDirs: string[] = []
private documentWasOpen = false
private relPath?: string
@@ -25,9 +24,7 @@ export class DiffViewProvider {
private streamedLines: string[] = []
private preDiagnostics: [vscode.Uri, vscode.Diagnostic[]][] = []
constructor(private cwd: string) {
this.skipAnimation = vscode.workspace.getConfiguration("cline.editor").get("skipDiffAnimation", false)
}
constructor(private cwd: string) {}
async open(relPath: string): Promise<void> {
this.relPath = relPath
@@ -95,37 +92,27 @@ export class DiffViewProvider {
throw new Error("User closed text editor, unable to edit file...")
}
// Place cursor at the beginning of the diff editor
// Place cursor at the beginning of the diff editor to keep it out of the way of the stream animation
const beginningOfDocument = new vscode.Position(0, 0)
diffEditor.selection = new vscode.Selection(beginningOfDocument, beginningOfDocument)
if (this.skipAnimation) {
// Apply all changes at once if animation is disabled
for (let i = 0; i < diffLines.length; i++) {
const currentLine = this.streamedLines.length + i
// Replace all content up to the current line with accumulated lines
// This is necessary (as compared to inserting one line at a time) to handle cases where html tags on previous lines are auto closed for example
const edit = new vscode.WorkspaceEdit()
const rangeToReplace = new vscode.Range(0, 0, document.lineCount, 0)
const contentToReplace = accumulatedLines.join("\n") + "\n"
const rangeToReplace = new vscode.Range(0, 0, currentLine + 1, 0)
const contentToReplace = accumulatedLines.slice(0, currentLine + 1).join("\n") + "\n"
edit.replace(document.uri, rangeToReplace, contentToReplace)
await vscode.workspace.applyEdit(edit)
this.streamedLines = accumulatedLines
} else {
// Original animation logic
for (let i = 0; i < diffLines.length; i++) {
const currentLine = this.streamedLines.length + i
const edit = new vscode.WorkspaceEdit()
const rangeToReplace = new vscode.Range(0, 0, currentLine + 1, 0)
const contentToReplace = accumulatedLines.slice(0, currentLine + 1).join("\n") + "\n"
edit.replace(document.uri, rangeToReplace, contentToReplace)
await vscode.workspace.applyEdit(edit)
// Update decorations
this.activeLineController.setActiveLine(currentLine)
this.fadedOverlayController.updateOverlayAfterLine(currentLine, document.lineCount)
// Scroll to the current line
this.scrollEditorToLine(currentLine)
}
// Update the streamedLines with the new accumulated content
this.streamedLines = accumulatedLines
// Update decorations
this.activeLineController.setActiveLine(currentLine)
this.fadedOverlayController.updateOverlayAfterLine(currentLine, document.lineCount)
// Scroll to the current line
this.scrollEditorToLine(currentLine)
}
// Update the streamedLines with the new accumulated content
this.streamedLines = accumulatedLines
if (isFinal) {
// Handle any remaining lines if the new content is shorter than the original
if (this.streamedLines.length < document.lineCount) {
-7
View File
@@ -1,7 +0,0 @@
export interface EditorSettings {
skipDiffAnimation: boolean
}
export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
skipDiffAnimation: false,
}