diff --git a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts index b4295876bf244..01524587c49db 100644 --- a/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts +++ b/packages/plugin-ext-vscode/src/browser/plugin-vscode-commands-contribution.ts @@ -32,7 +32,7 @@ import { EditorManager } from '@theia/editor/lib/browser'; import { TextDocumentShowOptions } from '@theia/plugin-ext/lib/common/plugin-api-rpc-model'; import { DocumentsMainImpl } from '@theia/plugin-ext/lib/main/browser/documents-main'; import { createUntitledResource } from '@theia/plugin-ext/lib/main/browser/editor/untitled-resource'; -import { fromViewColumn, toDocumentSymbol } from '@theia/plugin-ext/lib/plugin/type-converters'; +import { toDocumentSymbol } from '@theia/plugin-ext/lib/plugin/type-converters'; import { ViewColumn } from '@theia/plugin-ext/lib/plugin/types-impl'; import { WorkspaceCommands } from '@theia/workspace/lib/browser'; import { DiffService } from '@theia/workspace/lib/browser/diff-service'; @@ -89,12 +89,11 @@ export class PluginVscodeCommandsContribution implements CommandContribution { let options: TextDocumentShowOptions | undefined; if (typeof columnOrOptions === 'number') { options = { - viewColumn: fromViewColumn(columnOrOptions) + viewColumn: columnOrOptions }; } else if (columnOrOptions) { options = { - ...columnOrOptions, - viewColumn: fromViewColumn(columnOrOptions.viewColumn) + ...columnOrOptions }; } const editorOptions = DocumentsMainImpl.toEditorOpenerOptions(this.shell, options); diff --git a/packages/plugin-ext/src/main/browser/documents-main.ts b/packages/plugin-ext/src/main/browser/documents-main.ts index 5d1218ae1908a..918611e1e37ca 100644 --- a/packages/plugin-ext/src/main/browser/documents-main.ts +++ b/packages/plugin-ext/src/main/browser/documents-main.ts @@ -239,7 +239,8 @@ export class DocumentsMainImpl implements DocumentsMain, Disposable { widgetOptions = undefined; } else if (viewColumn > 0) { const tabBars = shell.mainAreaTabBars; - const tabBar = tabBars[viewColumn]; + // convert to zero-based index + const tabBar = tabBars[viewColumn - 1]; if (tabBar && tabBar.currentTitle) { widgetOptions = { ref: tabBar.currentTitle.owner }; }