grid - open editors in active group when no ViewColumn is provided

This commit is contained in:
Benjamin Pasero
2018-05-22 11:25:02 +02:00
parent db3acf9e92
commit 026fc297fb
4 changed files with 10 additions and 13 deletions

View File

@@ -11,7 +11,6 @@ import { TextEditorSelectionChangeKind } from './extHostTypes';
import * as TypeConverters from './extHostTypeConverters';
import { TextEditorDecorationType, ExtHostTextEditor } from './extHostTextEditor';
import { ExtHostDocumentsAndEditors } from './extHostDocumentsAndEditors';
import { EditorViewColumn } from 'vs/workbench/api/shared/editor';
import { MainContext, MainThreadTextEditorsShape, ExtHostEditorsShape, ITextDocumentShowOptions, ITextEditorPositionData, IMainContext, WorkspaceEditDto, IEditorPropertiesChangeData } from './extHost.protocol';
import * as vscode from 'vscode';
@@ -73,7 +72,6 @@ export class ExtHostEditors implements ExtHostEditorsShape {
};
} else {
options = {
position: 0 as EditorViewColumn,
preserveFocus: false
};
}

View File

@@ -158,23 +158,22 @@ export namespace DiagnosticSeverity {
export namespace ViewColumn {
export function from(column?: vscode.ViewColumn): EditorViewColumn {
let editorColumn = 0;
if (typeof column !== 'number') {
// stick with ONE
let editorColumn: EditorViewColumn;
if (column === <number>types.ViewColumn.One) {
editorColumn = 0;
} else if (column === <number>types.ViewColumn.Two) {
editorColumn = 1;
} else if (column === <number>types.ViewColumn.Three) {
editorColumn = 2;
} else if (column === <number>types.ViewColumn.Active) {
} else {
// in any other case (no column or ViewColumn.Active), leave the
// editorColumn as undefined which signals to use the active column
editorColumn = undefined;
}
return editorColumn;
}
export function to(position?: EditorViewColumn): vscode.ViewColumn {
if (typeof position !== 'number') {
return undefined;
}
if (position === 0) {
return <number>types.ViewColumn.One;
} else if (position === 1) {