Skip to content

Commit 3e015e7

Browse files
committed
Merge branch 'main' into cte/monorepo
2 parents 179d51c + 4e71b78 commit 3e015e7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/integrations/editor/DiffViewProvider.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,18 @@ export class DiffViewProvider {
122122
const endLine = accumulatedLines.length
123123
// Replace all content up to the current line with accumulated lines.
124124
const edit = new vscode.WorkspaceEdit()
125-
const rangeToReplace = new vscode.Range(0, 0, endLine + 1, 0)
125+
const rangeToReplace = new vscode.Range(0, 0, endLine, 0)
126126
const contentToReplace = accumulatedLines.slice(0, endLine + 1).join("\n") + "\n"
127127
edit.replace(document.uri, rangeToReplace, this.stripAllBOMs(contentToReplace))
128128
await vscode.workspace.applyEdit(edit)
129129
// Update decorations.
130130
this.activeLineController.setActiveLine(endLine)
131131
this.fadedOverlayController.updateOverlayAfterLine(endLine, document.lineCount)
132132
// Scroll to the current line.
133-
this.scrollEditorToLine(endLine)
133+
const ranges = this.activeDiffEditor?.visibleRanges
134+
if (ranges && ranges.length > 0 && ranges[0].start.line < endLine && ranges[0].end.line > endLine) {
135+
this.scrollEditorToLine(endLine)
136+
}
134137

135138
// Update the streamedLines with the new accumulated content.
136139
this.streamedLines = accumulatedLines

src/shared/combineApiRequests.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ export function combineApiRequests(messages: ClineMessage[]): ClineMessage[] {
4343
const result: ClineMessage[] = []
4444
const startedIndices: number[] = []
4545

46-
for (let i = 0; i < messages.length; i++) {
47-
const message = messages[i]
48-
46+
for (const message of messages) {
4947
if (message.type !== "say" || (message.say !== "api_req_started" && message.say !== "api_req_finished")) {
5048
result.push(message)
5149
continue

src/utils/xml-matcher.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ export class XmlMatcher<Result = XmlMatcherResult> {
4242
}
4343

4444
private _update(chunk: string) {
45-
for (let i = 0; i < chunk.length; i++) {
46-
const char = chunk[i]
45+
for (const char of chunk) {
4746
this.cached.push(char)
4847
this.pointer++
4948

0 commit comments

Comments
 (0)