From 16c1ab9ab5604ae4e86f09118ac82963729fc130 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Fri, 4 Apr 2025 02:14:33 -0400 Subject: [PATCH] Revert "Better logic for choosing the view column when opening Roo in a tab" (#2285) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Revert "Better logic for choosing the view column when opening Roo in a tab (…" This reverts commit 7eea755703777b7bf89d6696d3abb971805b6827. * Create hip-pumpkins-mate.md --- .changeset/hip-pumpkins-mate.md | 5 +++++ src/activate/registerCommands.ts | 18 +++++------------- 2 files changed, 10 insertions(+), 13 deletions(-) create mode 100644 .changeset/hip-pumpkins-mate.md diff --git a/.changeset/hip-pumpkins-mate.md b/.changeset/hip-pumpkins-mate.md new file mode 100644 index 0000000000..6b846b5370 --- /dev/null +++ b/.changeset/hip-pumpkins-mate.md @@ -0,0 +1,5 @@ +--- +"roo-cline": patch +--- + +Revert "Better logic for choosing the view column when opening Roo in a tab" diff --git a/src/activate/registerCommands.ts b/src/activate/registerCommands.ts index a544d6c707..4af6b81c54 100644 --- a/src/activate/registerCommands.ts +++ b/src/activate/registerCommands.ts @@ -123,26 +123,18 @@ export const openClineInNewTab = async ({ context, outputChannel }: Omit editor.viewColumn || 0)) - const activeEditor = vscode.window.activeTextEditor + // Check if there are any visible text editors, otherwise open a new group + // to the right. const hasVisibleEditors = vscode.window.visibleTextEditors.length > 0 - let targetCol: vscode.ViewColumn - if (!hasVisibleEditors) { - // No editors open, open in first column - targetCol = vscode.ViewColumn.One - } else if (activeEditor && activeEditor.document.isUntitled && vscode.window.visibleTextEditors.length === 1) { - // Only one editor and it's empty (untitled), reuse it - targetCol = activeEditor.viewColumn ?? vscode.ViewColumn.One - } else { - // Otherwise, create a new group to the right await vscode.commands.executeCommand("workbench.action.newGroupRight") - // New group becomes the last + 1 - const lastCol = Math.max(...vscode.window.visibleTextEditors.map((e) => e.viewColumn || 1)) - targetCol = (lastCol + 1) as vscode.ViewColumn } + const targetCol = hasVisibleEditors ? Math.max(lastCol + 1, 1) : vscode.ViewColumn.Two + const newPanel = vscode.window.createWebviewPanel(ClineProvider.tabPanelId, "Roo Code", targetCol, { enableScripts: true, retainContextWhenHidden: true,