Skip to content

Commit 6f25393

Browse files
hsfzxjybpasero
andauthored
Fix microsoft#185858: Add option to enable/disable editor group maximization on double clicking tab title (microsoft#185966)
* Add option to enable/disable editor group maximization on double clicking tab title (microsoft#185858) * update description --------- Co-authored-by: Benjamin Pasero <[email protected]>
1 parent f3d8406 commit 6f25393

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

src/vs/workbench/browser/parts/editor/editor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = {
4242
splitSizing: 'auto',
4343
splitOnDragAndDrop: true,
4444
centeredLayoutFixedWidth: false,
45+
doubleClickTabToToggleEditorGroupSizes: true,
4546
};
4647

4748
export function impactsEditorPartOptions(event: IConfigurationChangeEvent): boolean {

src/vs/workbench/browser/parts/editor/tabsTitleControl.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,9 @@ export class TabsTitleControl extends TitleControl {
956956

957957
const editor = this.group.getEditorByIndex(index);
958958
if (editor && this.group.isPinned(editor)) {
959-
this.accessor.arrangeGroups(GroupsArrangement.TOGGLE, this.group);
959+
if (this.accessor.partOptions.doubleClickTabToToggleEditorGroupSizes) {
960+
this.accessor.arrangeGroups(GroupsArrangement.TOGGLE, this.group);
961+
}
960962
} else {
961963
this.group.pinEditor(editor);
962964
}

src/vs/workbench/browser/workbench.contribution.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,11 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
282282
'default': false,
283283
'description': localize('centeredLayoutDynamicWidth', "Controls whether the centered layout tries to maintain constant width when the window is resized.")
284284
},
285+
'workbench.editor.doubleClickTabToToggleEditorGroupSizes': {
286+
'type': 'boolean',
287+
'default': true,
288+
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'doubleClickTabToToggleEditorGroupSizes' }, "Controls whether to maximize/restore the editor group when double clicking on a tab. This value is ignored when `#workbench.editor.showTabs#` is disabled.")
289+
},
285290
'workbench.editor.limit.enabled': {
286291
'type': 'boolean',
287292
'default': false,

src/vs/workbench/common/editor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,7 @@ interface IEditorPartConfiguration {
11161116
splitSizing?: 'auto' | 'split' | 'distribute';
11171117
splitOnDragAndDrop?: boolean;
11181118
centeredLayoutFixedWidth?: boolean;
1119+
doubleClickTabToToggleEditorGroupSizes?: boolean;
11191120
limit?: {
11201121
enabled?: boolean;
11211122
excludeDirty?: boolean;

0 commit comments

Comments
 (0)