diff --git a/src/editorGroupTreeDataProvider.ts b/src/editorGroupTreeDataProvider.ts index 37b70df..3152016 100644 --- a/src/editorGroupTreeDataProvider.ts +++ b/src/editorGroupTreeDataProvider.ts @@ -6,7 +6,7 @@ import { EditorGroup } from './editorGroup'; export class EditorGroupTreeDataProvider implements vscode.TreeDataProvider { private _onDidChangeTreeData: vscode.EventEmitter = new vscode.EventEmitter(); readonly onDidChangeTreeData: vscode.Event = this._onDidChangeTreeData.event; - + context: vscode.ExtensionContext; constructor(cont: vscode.ExtensionContext) { @@ -31,17 +31,17 @@ export class EditorGroupTreeDataProvider implements vscode.TreeDataProvider>('minimizedGroups'); const primed = minimizedGroups?.map((group) => { const documents = group.documents?.map(({ document, viewColumn }) => new EditorDocument(document, viewColumn)); return new EditorGroup( - group.label, - vscode.TreeItemCollapsibleState.Collapsed, + group.label, + vscode.TreeItemCollapsibleState.Collapsed, documents, ); }); - + return this.context.workspaceState.update('minimizedGroups', primed) .then(() => primed); } @@ -67,6 +67,8 @@ export class EditorGroupTreeDataProvider implements vscode.TreeDataProvider { const documents: EditorDocument[] = []; const minimizedGroups = this.context.workspaceState.get>('minimizedGroups') || []; + await vscode.commands.executeCommand('workbench.action.openEditorAtIndex1'); + await vscode.commands.executeCommand('workbench.files.action.focusOpenEditorsView'); let activeTextEditor = vscode.window.activeTextEditor; let pinnedCheck = activeTextEditor; @@ -74,10 +76,8 @@ export class EditorGroupTreeDataProvider implements vscode.TreeDataProvider