From 6eec882e72e83053c881bc216dd320eefd10b1ea Mon Sep 17 00:00:00 2001 From: Saoud Rizwan <7799382+saoudrizwan@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:53:11 -0400 Subject: [PATCH] Fix in-memory doc closing logic --- src/ClaudeDev.ts | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/ClaudeDev.ts b/src/ClaudeDev.ts index 288af09603..1c6728bd11 100644 --- a/src/ClaudeDev.ts +++ b/src/ClaudeDev.ts @@ -866,16 +866,10 @@ export class ClaudeDev { const closeInMemoryDocAndDiffViews = async () => { // ensure that the in-memory doc is active editor (this seems to fail on windows machines if its already active, so ignoring if there's an error as it's likely it's already active anyways) try { - const matchingEditor = vscode.window.visibleTextEditors.find( - (editor) => editor.document.uri === inMemoryDocument.uri - ) - if (matchingEditor) { - await vscode.window.showTextDocument(matchingEditor.document, { - viewColumn: matchingEditor.viewColumn, - preview: true, - preserveFocus: false, - }) - } + await vscode.window.showTextDocument(inMemoryDocument, { + preview: true, + preserveFocus: false, + }) // await vscode.window.showTextDocument(inMemoryDocument.uri, { preview: true, preserveFocus: false }) } catch (error) { console.log(`Could not open editor for ${absolutePath}: ${error}`)