mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
Make sure we restore the previous editor when switching back to it
This commit is contained in:
@@ -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
|
||||
]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user