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 14, 2022
1 parent 183c46f commit ffc6def
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 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,17 @@ 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.ref = mainAreaTerminals[column - 1];
}
}
}
Expand Down

0 comments on commit ffc6def

Please sign in to comment.