Explorar el Código

Fix issue where cline's edits would stream into active editor instead of diff view editor

Saoud Rizwan hace 1 año
padre
commit
cc4825efc3
Se han modificado 1 ficheros con 4 adiciones y 8 borrados
  1. 4 8
      src/integrations/editor/DiffViewProvider.ts

+ 4 - 8
src/integrations/editor/DiffViewProvider.ts

@@ -89,16 +89,12 @@ export class DiffViewProvider {
 			accumulatedLines.pop() // remove the last partial line only if it's not the final update
 		}
 		const diffLines = accumulatedLines.slice(this.streamedLines.length)
-		const document = vscode.window.activeTextEditor?.document
+
+		const document = this.activeDiffEditor?.document
 		if (!document) {
-			console.error("No active text editor")
-			return
-		}
-		const diffViewEditor = vscode.window.activeTextEditor
-		if (!diffViewEditor) {
-			console.error("No active diff view editor")
-			return
+			throw new Error("User closed text editor, unable to edit file...")
 		}
+
 		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