mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
grid - open editors in active group when no ViewColumn is provided
This commit is contained in:
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user