Skip to content

Commit

Permalink
adopt vscode.ViewColumn.Beside
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Jun 14, 2018
1 parent c7f9a7a commit 5399d63
Showing 1 changed file with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,6 @@ import { MarkdownPreviewManager } from '../features/previewManager';
import { TelemetryReporter } from '../telemetryReporter';
import { PreviewSettings } from '../features/preview';


function getViewColumn(sideBySide: boolean): vscode.ViewColumn | undefined {
const active = vscode.window.activeTextEditor;
if (!active) {
return vscode.ViewColumn.One;
}

if (!sideBySide) {
return active.viewColumn;
}

switch (active.viewColumn) {
case vscode.ViewColumn.One:
return vscode.ViewColumn.Two;
case vscode.ViewColumn.Two:
return vscode.ViewColumn.Three;
}

return active.viewColumn;
}

interface ShowPreviewSettings {
readonly sideBySide?: boolean;
readonly locked?: boolean;
Expand Down Expand Up @@ -61,7 +40,7 @@ async function showPreview(

webviewManager.preview(resource, {
resourceColumn: (vscode.window.activeTextEditor && vscode.window.activeTextEditor.viewColumn) || vscode.ViewColumn.One,
previewColumn: getViewColumn(!!previewSettings.sideBySide) || vscode.ViewColumn.Active,
previewColumn: previewSettings.sideBySide ? vscode.ViewColumn.Beside : vscode.ViewColumn.Active,
locked: !!previewSettings.locked
});

Expand Down

0 comments on commit 5399d63

Please sign in to comment.