Skip to content

Commit

Permalink
Revise behavior of TerminalEditorLocationOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
xai committed Dec 15, 2022
1 parent 183c46f commit 9ed3a73
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions packages/terminal/src/browser/terminal-frontend-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -657,22 +657,18 @@ export class TerminalFrontendContribution implements FrontendApplicationContribu
switch (widget.location.viewColumn) {
case ViewColumn.Active:
widgetOptions.ref = this.shell.currentWidget;
widgetOptions.mode = 'tab-before';
widgetOptions.mode = 'tab-after';
break;
case ViewColumn.Beside:
widgetOptions.ref = this.shell.currentWidget;
widgetOptions.mode = 'tab-after';
widgetOptions.mode = 'split-right';
break;
default:
const widgets = this.all.filter(t => t.isVisible);
const index = widget.location.viewColumn - 1;
if (index < widgets.length) {
widgetOptions.ref = widgets[index];
widgetOptions.mode = 'open-to-left';
} else {
widgetOptions.ref = widgets[widgets.length - 1];
widgetOptions.mode = 'open-to-right';
}
widgetOptions.area = 'main';
const mainAreaTerminals = this.shell.getWidgets('main').filter(w => w instanceof TerminalWidget && w.isVisible);
const column = widget.location.viewColumn <= mainAreaTerminals.length ? widget.location.viewColumn : mainAreaTerminals.length;
widgetOptions.mode = widget.location.viewColumn <= mainAreaTerminals.length ? 'split-left' : 'split-right';
widgetOptions.ref = mainAreaTerminals[column - 1];
}
}
}
Expand Down

0 comments on commit 9ed3a73

Please sign in to comment.