Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/vs/workbench/browser/parts/editor/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = {
tabSizing: 'fit',
tabSizingFixedMinWidth: 50,
tabSizingFixedMaxWidth: 160,
tabTitleDisplayType: 'title',
pinnedTabSizing: 'normal',
pinnedTabsOnSeparateRow: false,
tabHeight: 'default',
Expand Down Expand Up @@ -139,6 +140,7 @@ function validateEditorPartOptions(options: IEditorPartOptions): IEditorPartOpti

'tabSizingFixedMinWidth': new NumberVerifier(DEFAULT_EDITOR_PART_OPTIONS['tabSizingFixedMinWidth']),
'tabSizingFixedMaxWidth': new NumberVerifier(DEFAULT_EDITOR_PART_OPTIONS['tabSizingFixedMaxWidth']),
'tabTitleDisplayType': new EnumVerifier(DEFAULT_EDITOR_PART_OPTIONS['tabTitleDisplayType'], ['title', 'name', 'title+name', 'name+title']),

'showTabs': new EnumVerifier(DEFAULT_EDITOR_PART_OPTIONS['showTabs'], ['multiple', 'single', 'none']),
'tabActionLocation': new EnumVerifier(DEFAULT_EDITOR_PART_OPTIONS['tabActionLocation'], ['left', 'right']),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1443,7 +1443,14 @@ export class MultiEditorTabsControl extends EditorTabsControl {
tabContainer.setAttribute('aria-description', '');
}

const title = tabLabel.title || '';
let title = tabLabel.title || '';
if (options.tabTitleDisplayType === 'name') {
title = tabLabel.name || '';
} else if (options.tabTitleDisplayType === 'name+title') {
title = (tabLabel.name ? `${tabLabel.name}\r\n` : '') + (tabLabel.title || '');
} else if (options.tabTitleDisplayType === 'title+name') {
title = (tabLabel.title ? `${tabLabel.title}\r\n` : '') + (tabLabel.name || '');
}
tabContainer.title = title;

// Label
Expand Down
11 changes: 11 additions & 0 deletions src/vs/workbench/browser/workbench.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,17 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
'minimum': 38,
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.editor.tabSizingFixedMaxWidth' }, "Controls the maximum width of tabs when `#workbench.editor.tabSizing#` size is set to `fixed`.")
},
'workbench.editor.tabTitleDisplayType': {
'type': 'string',
'enum': ['title', 'name', 'name+title', 'title+name'],
'enumDescriptions': [
localize('workbench.editor.tabTitleDisplayType.title', "Display tab title."),
localize('workbench.editor.tabTitleDisplayType.name', "Display tab name."),
localize('workbench.editor.tabTitleDisplayType.titleAndName', "Display tab title and name."),
localize('workbench.editor.tabTitleDisplayType.nameAndTitle', "Display tab name and title.")
],
'default': 'title'
},
'window.density.editorTabHeight': {
'type': 'string',
'enum': ['default', 'compact'],
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1144,6 +1144,7 @@ interface IEditorPartConfiguration {
tabSizing?: 'fit' | 'shrink' | 'fixed';
tabSizingFixedMinWidth?: number;
tabSizingFixedMaxWidth?: number;
tabTitleDisplayType?: 'title' | 'name' | 'title+name' | 'name+title';
pinnedTabSizing?: 'normal' | 'compact' | 'shrink';
pinnedTabsOnSeparateRow?: boolean;
tabHeight?: 'default' | 'compact';
Expand Down