Skip to content

Commit

Permalink
await openEditorAtIndex1 command (#2442)
Browse files Browse the repository at this point in the history
Previously there was a bug in VSCode which prevented me from doing:
```
await
vscode.commands.executeCommand('workbench.action.openEditorAtIndex1')
```

The most recent release of VSCode (1.21.0) fixes the bug. See
microsoft/vscode#44636
  • Loading branch information
arussellk authored and jpoon committed Mar 12, 2018
1 parent 1ad1252 commit fb0e1e8
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cmd_line/commands/tab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ export class TabCommand extends node.CommandBase {
switch (this._arguments.tab) {
case Tab.Next:
if (this._arguments.count /** not undefined or 0 */) {
// do not await workbench.action.openEditorAtIndex1 because it will never resolve
vscode.commands.executeCommand('workbench.action.openEditorAtIndex1');
await vscode.commands.executeCommand('workbench.action.openEditorAtIndex1');
await this.executeCommandWithCount(
this._arguments.count! - 1,
'workbench.action.nextEditorInGroup'
Expand All @@ -68,8 +67,7 @@ export class TabCommand extends node.CommandBase {
);
break;
case Tab.First:
// do not await workbench.action.openEditorAtIndex1 because it will never resolve
vscode.commands.executeCommand('workbench.action.openEditorAtIndex1');
await vscode.commands.executeCommand('workbench.action.openEditorAtIndex1');
break;
case Tab.Last:
await vscode.commands.executeCommand('workbench.action.openLastEditorInGroup');
Expand Down

0 comments on commit fb0e1e8

Please sign in to comment.