diff --git a/src/vs/workbench/parts/files/browser/explorerViewlet.ts b/src/vs/workbench/parts/files/browser/explorerViewlet.ts index 12962a0600069e452b4cbc33a48d122732848655..128a2d80c5687fda91b48dd944ce464aed399ae8 100644 --- a/src/vs/workbench/parts/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/browser/explorerViewlet.ts @@ -61,7 +61,7 @@ export class ExplorerViewlet extends Viewlet { return this.configurationService.loadConfiguration().then((config:IFilesConfiguration) => { // Open editors view should always be visible in no folder workspace. - this.openEditorsVisible = !this.contextService.getWorkspace() || config.explorer.openEditors.maxVisible !== 0; + this.openEditorsVisible = !this.contextService.getWorkspace() || config.explorer.openEditors.visible !== 0; if (this.openEditorsVisible) { this.splitView = new SplitView(this.viewletContainer.getHTMLElement()); diff --git a/src/vs/workbench/parts/files/browser/files.contribution.ts b/src/vs/workbench/parts/files/browser/files.contribution.ts index 34a45dbe14e2f789242a9ceb6470efbda0e3f753..d6b922a63558a365900dd06b4a66831b9e217c69 100644 --- a/src/vs/workbench/parts/files/browser/files.contribution.ts +++ b/src/vs/workbench/parts/files/browser/files.contribution.ts @@ -238,9 +238,9 @@ configurationRegistry.registerConfiguration({ 'title': nls.localize('explorerConfigurationTitle', "File Explorer configuration"), 'type': 'object', 'properties': { - 'explorer.openEditors.maxVisible': { + 'explorer.openEditors.visible': { 'type': 'number', - 'description': nls.localize('maxVisible', "Maximum number of open editors to show before scrollbars appear. If set to 0 open editors section gets hidden - only applied after VSCode restart."), + 'description': nls.localize('openEditorsVisible', "Number of editors shown in the Open Editors pane. Set it to 0 to hide the pane."), 'default': 9 }, 'explorer.openEditors.dynamicHeight': { diff --git a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts index 2b103b3aaf297864649bb4e67bde141d02d75d71..cae18b21d0cfff90e83434db7ce6ae1839d37b9a 100644 --- a/src/vs/workbench/parts/files/browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/browser/views/openEditorsView.ts @@ -31,11 +31,11 @@ const $ = dom.emmet; export class OpenEditorsView extends AdaptiveCollapsibleViewletView { private static MEMENTO_COLLAPSED = 'openEditors.memento.collapsed'; - private static DEFAULT_MAX_VISIBLE_OPEN_EDITORS = 9; + private static DEFAULT_VISIBLE_OPEN_EDITORS = 9; private static DEFAULT_DYNAMIC_HEIGHT = true; private settings: any; - private maxVisibleOpenEditors: number; + private visibleOpenEditors: number; private dynamicHeight: boolean; private model: IEditorStacksModel; @@ -178,11 +178,11 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { } private onConfigurationUpdated(configuration: IFilesConfiguration): void { - let visibleOpenEditors = configuration && configuration.explorer && configuration.explorer.openEditors && configuration.explorer.openEditors.maxVisible; + let visibleOpenEditors = configuration && configuration.explorer && configuration.explorer.openEditors && configuration.explorer.openEditors.visible; if (typeof visibleOpenEditors === 'number') { - this.maxVisibleOpenEditors = visibleOpenEditors; + this.visibleOpenEditors = visibleOpenEditors; } else { - this.maxVisibleOpenEditors = OpenEditorsView.DEFAULT_MAX_VISIBLE_OPEN_EDITORS; + this.visibleOpenEditors = OpenEditorsView.DEFAULT_VISIBLE_OPEN_EDITORS; } let dynamicHeight = configuration && configuration.explorer && configuration.explorer.openEditors && configuration.explorer.openEditors.dynamicHeight; @@ -241,17 +241,17 @@ export class OpenEditorsView extends AdaptiveCollapsibleViewletView { } private getExpandedBodySize(model: IEditorStacksModel): number { - return OpenEditorsView.computeExpandedBodySize(model, this.maxVisibleOpenEditors, this.dynamicHeight); + return OpenEditorsView.computeExpandedBodySize(model, this.visibleOpenEditors, this.dynamicHeight); } - private static computeExpandedBodySize(model: IEditorStacksModel, maxVisibleOpenEditors = OpenEditorsView.DEFAULT_MAX_VISIBLE_OPEN_EDITORS, dynamicHeight = OpenEditorsView.DEFAULT_DYNAMIC_HEIGHT): number { + private static computeExpandedBodySize(model: IEditorStacksModel, visibleOpenEditors = OpenEditorsView.DEFAULT_VISIBLE_OPEN_EDITORS, dynamicHeight = OpenEditorsView.DEFAULT_DYNAMIC_HEIGHT): number { const entryCount = model.groups.reduce((sum, group) => sum + group.count, 0); let itemsToShow: number; if (dynamicHeight) { - itemsToShow = Math.min(Math.max(maxVisibleOpenEditors, 1), entryCount); + itemsToShow = Math.min(Math.max(visibleOpenEditors, 1), entryCount); } else { - itemsToShow = Math.max(maxVisibleOpenEditors, 1); + itemsToShow = Math.max(visibleOpenEditors, 1); } // We only show the group labels if there is more than 1 group if (model.groups.length > 1) { diff --git a/src/vs/workbench/parts/files/common/files.ts b/src/vs/workbench/parts/files/common/files.ts index 3883cfa9dfe1c77711897d0c8608bbde7bf069e8..8f64b797bc6a3824f8f2df275db17cbb6a52bdd6 100644 --- a/src/vs/workbench/parts/files/common/files.ts +++ b/src/vs/workbench/parts/files/common/files.ts @@ -60,7 +60,7 @@ export abstract class FileEditorInput extends EditorInput implements IFileEditor export interface IFilesConfiguration extends IFilesConfiguration { explorer: { openEditors: { - maxVisible: number; + visible: number; dynamicHeight: boolean; }; autoReveal: boolean;