Make sure we restore the previous editor when switching back to it

This commit is contained in:
Matt Bierner
2020-01-10 16:24:55 -08:00
parent 4fb03413db
commit cb4ef36e6d
3 changed files with 37 additions and 19 deletions

View File

@@ -134,16 +134,20 @@ CommandsRegistry.registerCommand(OpenAPICommand.ID, adjustHandler(OpenAPICommand
export class OpenWithAPICommand {
public static readonly ID = 'vscode.openWith';
public static execute(executor: ICommandsExecutor, resource: URI, viewType: string, column?: vscode.ViewColumn): Promise<any> {
public static execute(executor: ICommandsExecutor, resource: URI, viewType: string, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions): Promise<any> {
let options: ITextEditorOptions | undefined;
let position: EditorViewColumn | undefined;
if (typeof column === 'number') {
position = typeConverters.ViewColumn.from(column);
if (typeof columnOrOptions === 'number') {
position = typeConverters.ViewColumn.from(columnOrOptions);
} else if (typeof columnOrOptions !== 'undefined') {
options = typeConverters.TextEditorOptions.from(columnOrOptions);
}
return executor.executeCommand('_workbench.openWith', [
resource,
viewType,
options,
position
]);
}