mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 19:41:08 -05:00
Split editor action does not show as disabled when limit hit (fixes #7651)
This commit is contained in:
@@ -89,7 +89,37 @@ export abstract class TitleControl {
|
||||
this.initActions();
|
||||
}
|
||||
|
||||
private updateActionEnablement(): void {
|
||||
if (!this.context) {
|
||||
return;
|
||||
}
|
||||
|
||||
const group = this.context;
|
||||
const groupCount = this.stacks.groups.length;
|
||||
|
||||
// Move group
|
||||
switch (this.stacks.positionOfGroup(group)) {
|
||||
case Position.LEFT:
|
||||
this.moveGroupLeftAction.enabled = false;
|
||||
this.moveGroupRightAction.enabled = this.stacks.groups.length > 1;
|
||||
break;
|
||||
|
||||
case Position.CENTER:
|
||||
this.moveGroupRightAction.enabled = this.stacks.groups.length > 2;
|
||||
break;
|
||||
|
||||
case Position.RIGHT:
|
||||
this.moveGroupRightAction.enabled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Split editor
|
||||
this.splitEditorAction.enabled = groupCount < 3;
|
||||
}
|
||||
|
||||
private onSchedule(): void {
|
||||
this.updateActionEnablement();
|
||||
|
||||
if (this.refreshScheduled) {
|
||||
this.doRefresh();
|
||||
} else {
|
||||
@@ -294,22 +324,6 @@ export abstract class TitleControl {
|
||||
primary.push(this.splitEditorAction);
|
||||
}
|
||||
|
||||
// Make sure enablement is good
|
||||
switch (this.stacks.positionOfGroup(group)) {
|
||||
case Position.LEFT:
|
||||
this.moveGroupLeftAction.enabled = false;
|
||||
this.moveGroupRightAction.enabled = this.stacks.groups.length > 1;
|
||||
break;
|
||||
|
||||
case Position.CENTER:
|
||||
this.moveGroupRightAction.enabled = this.stacks.groups.length > 2;
|
||||
break;
|
||||
|
||||
case Position.RIGHT:
|
||||
this.moveGroupRightAction.enabled = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Return actions
|
||||
const secondary = [
|
||||
this.moveGroupLeftAction,
|
||||
|
||||
Reference in New Issue
Block a user