mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 20:31:37 -05:00
Move cursor to beginning of file during stream animation
This commit is contained in:
@@ -90,11 +90,16 @@ export class DiffViewProvider {
|
|||||||
}
|
}
|
||||||
const diffLines = accumulatedLines.slice(this.streamedLines.length)
|
const diffLines = accumulatedLines.slice(this.streamedLines.length)
|
||||||
|
|
||||||
const document = this.activeDiffEditor?.document
|
const diffEditor = this.activeDiffEditor
|
||||||
if (!document) {
|
const document = diffEditor?.document
|
||||||
|
if (!diffEditor || !document) {
|
||||||
throw new Error("User closed text editor, unable to edit file...")
|
throw new Error("User closed text editor, unable to edit file...")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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)
|
||||||
|
|
||||||
for (let i = 0; i < diffLines.length; i++) {
|
for (let i = 0; i < diffLines.length; i++) {
|
||||||
const currentLine = this.streamedLines.length + i
|
const currentLine = this.streamedLines.length + i
|
||||||
// Replace all content up to the current line with accumulated lines
|
// Replace all content up to the current line with accumulated lines
|
||||||
|
|||||||
Reference in New Issue
Block a user