diff --git a/src/vs/workbench/browser/parts/editor/editor.contribution.ts b/src/vs/workbench/browser/parts/editor/editor.contribution.ts index f2f38bfa1bc63dcc73af291898cb1da5dae91627..d7ca9a12d445803b40eb8c9c5fdf92a5e2d33540 100644 --- a/src/vs/workbench/browser/parts/editor/editor.contribution.ts +++ b/src/vs/workbench/browser/parts/editor/editor.contribution.ts @@ -447,26 +447,26 @@ configurationRegistry.registerConfiguration({ 'title': nls.localize('workbenchConfigurationTitle', "Workbench configuration"), 'type': 'object', 'properties': { - 'workbench.showEditorTabs': { + 'workbench.editor.showTabs': { 'type': 'boolean', 'description': nls.localize('showEditorTabs', "Controls if opened editors should show in tabs or not."), 'default': false }, - 'workbench.previewEditors': { + 'workbench.editor.enablePreview': { 'type': 'boolean', - 'description': nls.localize('previewEditors', "Controls if opened editors show as preview until getting pinned. Set to false to always open editors pinned."), + 'description': nls.localize('enablePreview', "Controls if opened editors show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."), 'default': true }, - 'workbench.quickOpenPreviews': { + 'workbench.editor.enablePreviewFromQuickOpen': { 'type': 'boolean', - 'description': nls.localize('quickOpenPreviews', "Controls if editors opened from quick open show as preview. Set to false to always open editors from quick open pinned."), + 'description': nls.localize('enablePreviewFromQuickOpen', "Controls if opened editors from quick open show as preview. Preview editors are reused until they are kept (e.g. via double click or editing)."), 'default': true }, - 'workbench.editorOpenPositioning': { + 'workbench.editor.openPositioning': { 'type': 'string', - 'enum': ['left', 'right', 'beginning', 'end'], + 'enum': ['left', 'right', 'first', 'last'], 'default': 'right', - 'description': nls.localize('editorOpenPositioning', "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the current active one. Select 'beginning' or 'end' to open editors independently from the currently active one.") + 'description': nls.localize('editorOpenPositioning', "Controls where editors open. Select 'left' or 'right' to open editors to the left or right of the current active one. Select 'first' or 'last' to open editors independently from the currently active one.") } } }); \ No newline at end of file diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index 27412c2bc659cb0ea900c60e71bf3497350ff801..0897b7283d27c95dfda4b80fc9154635a59d7ded 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -128,7 +128,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService this.stacks = this.instantiationService.createInstance(EditorStacksModel); - this.previewEditors = configurationService.getConfiguration().workbench.previewEditors; + this.previewEditors = configurationService.getConfiguration().workbench.editor.enablePreview; this.registerListeners(); } @@ -140,7 +140,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService } private onConfigurationUpdated(configuration: IWorkbenchEditorConfiguration): void { - const newPreviewEditors = configuration.workbench.previewEditors; + const newPreviewEditors = configuration.workbench.editor.enablePreview; // Pin all preview editors of the user chose to disable preview if (this.previewEditors !== newPreviewEditors && !newPreviewEditors) { diff --git a/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts b/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts index 9c4029c641d4398f4c1e0020063ba4f8b26f384a..bfbfd2e6a710c3b0e867e0857999ebccca195fe7 100644 --- a/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts +++ b/src/vs/workbench/browser/parts/editor/sideBySideEditorControl.ts @@ -167,7 +167,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti const titleControl = this.titleAreaControl[position]; if (titleControl) { const usingTabs = (titleControl instanceof TabsTitleControl); - const useTabs = configuration.workbench.showEditorTabs; + const useTabs = configuration.workbench.editor.showTabs; if (usingTabs !== useTabs) { // Dispose old @@ -837,7 +837,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti } // Multiple resources to open with tabs: open them all in target position - const showsTabs = this.configurationService.getConfiguration().workbench.showEditorTabs; + const showsTabs = this.configurationService.getConfiguration().workbench.editor.showTabs; if (showsTabs) { return this.editorService.openEditors(resources.map(resource => { return { input: { resource, options: { pinned: true } }, position }; })).then(() => this.editorGroupService.focusGroup(position)); } @@ -847,7 +847,7 @@ export class SideBySideEditorControl implements ISideBySideEditorControl, IVerti } private createTitleControl(position: Position): void { - const useTabs = !!this.configurationService.getConfiguration().workbench.showEditorTabs; + const useTabs = !!this.configurationService.getConfiguration().workbench.editor.showTabs; this.titleAreaControl[position] = useTabs ? this.instantiationService.createInstance(TabsTitleControl) : this.instantiationService.createInstance(NoTabsTitleControl); this.titleAreaControl[position].create(this.titleContainer[position].getHTMLElement()); diff --git a/src/vs/workbench/browser/parts/editor/titleControl.ts b/src/vs/workbench/browser/parts/editor/titleControl.ts index 7e5ea3ba7a52ec622c4d8ce0f21bb3d017f08d04..834d233657ec0f733e3aa1e35588e4847eff1841 100644 --- a/src/vs/workbench/browser/parts/editor/titleControl.ts +++ b/src/vs/workbench/browser/parts/editor/titleControl.ts @@ -103,8 +103,8 @@ export abstract class TitleControl { } private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { - this.previewEditors = config.workbench.previewEditors; - this.showTabs = config.workbench.showEditorTabs; + this.previewEditors = config.workbench.editor.enablePreview; + this.showTabs = config.workbench.editor.showTabs; } private updateActionEnablement(): void { diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index fafbc01b194c9ae1e327ba6e9f600f6a2d6f3aed..a8c28c53c20428e740b05d4dddfd87d9f639e1c7 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -1023,7 +1023,7 @@ export class EditorHistoryEntry extends EditorQuickOpenEntry { public run(mode: Mode, context: IEntryRunContext): boolean { if (mode === Mode.OPEN) { const sideBySide = !context.quickNavigateConfiguration && context.keymods.indexOf(KeyMod.CtrlCmd) >= 0; - const pinned = !this.configurationService.getConfiguration().workbench.quickOpenPreviews; + const pinned = !this.configurationService.getConfiguration().workbench.editor.enablePreviewFromQuickOpen; this.editorService.openEditor(this.input, EditorOptions.create({ pinned }), sideBySide).done(null, errors.onUnexpectedError); diff --git a/src/vs/workbench/common/editor.ts b/src/vs/workbench/common/editor.ts index 4153795110d6c5acf5358b1986564337210452f4..e187c46a96ff31d2d98704c45d4d4bbeeee71c31 100644 --- a/src/vs/workbench/common/editor.ts +++ b/src/vs/workbench/common/editor.ts @@ -681,15 +681,17 @@ export type GroupIdentifier = number; export const EditorOpenPositioning = { LEFT: 'left', RIGHT: 'right', - BEGINNING: 'beginning', - END: 'end' + FIRST: 'first', + LAST: 'last' }; export interface IWorkbenchEditorConfiguration { workbench: { - showEditorTabs: boolean; - previewEditors: boolean; - quickOpenPreviews: boolean; - editorOpenPositioning: string; + editor: { + showTabs: boolean; + enablePreview: boolean; + enablePreviewFromQuickOpen: boolean; + openPositioning: string; + } }; } \ No newline at end of file diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index 587972b990f932c0f4585c6591a3eba3f29160a2..1ab6b5d8c0316b6faaa6260890af2e092bb63bbb 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -117,7 +117,7 @@ export class EditorGroup implements IEditorGroup { } private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void { - this.editorOpenPositioning = config.workbench.editorOpenPositioning; + this.editorOpenPositioning = config.workbench.editor.openPositioning; } public get id(): GroupIdentifier { @@ -217,12 +217,12 @@ export class EditorGroup implements IEditorGroup { } // Insert to the BEGINNING - else if (this.editorOpenPositioning === EditorOpenPositioning.BEGINNING) { + else if (this.editorOpenPositioning === EditorOpenPositioning.FIRST) { targetIndex = 0; } // Insert to the END - else if (this.editorOpenPositioning === EditorOpenPositioning.END) { + else if (this.editorOpenPositioning === EditorOpenPositioning.LAST) { targetIndex = this.editors.length; } diff --git a/src/vs/workbench/parts/files/browser/explorerViewlet.ts b/src/vs/workbench/parts/files/browser/explorerViewlet.ts index 3211cd1321257cf23f1acce04efba3405325181c..52b0c9c51267f10e2ce99ef8a80c240839f2f64d 100644 --- a/src/vs/workbench/parts/files/browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/browser/explorerViewlet.ts @@ -87,7 +87,7 @@ export class ExplorerViewlet extends Viewlet { private onConfigurationUpdated(config: IFilesConfiguration): TPromise { // No need to delay if preview is disabled - this.delayEditorOpeningInOpenedEditors = !!config.workbench.previewEditors; + this.delayEditorOpeningInOpenedEditors = !!config.workbench.editor.enablePreview; // Open editors view should always be visible in no folder workspace. let openEditorsVisible = !this.contextService.getWorkspace() || config.explorer.openEditors.visible !== 0; diff --git a/src/vs/workbench/parts/search/browser/openFileHandler.ts b/src/vs/workbench/parts/search/browser/openFileHandler.ts index a69313c48c8d00289c5f3f41b250ed5cfe68c090..9b3587db32404f9b933d6246fb5c2c1902001373 100644 --- a/src/vs/workbench/parts/search/browser/openFileHandler.ts +++ b/src/vs/workbench/parts/search/browser/openFileHandler.ts @@ -75,7 +75,7 @@ export class FileEntry extends EditorQuickOpenEntry { let input: IResourceInput = { resource: this.resource, options: { - pinned: !this.configurationService.getConfiguration().workbench.quickOpenPreviews + pinned: !this.configurationService.getConfiguration().workbench.editor.enablePreviewFromQuickOpen } }; diff --git a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts index dc65da6d52973803aa536c2566d86e04eee42b67..206c7c0a24f7fefed1e6c5b0bc17942c58f0d734 100644 --- a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts @@ -85,7 +85,7 @@ class SymbolEntry extends EditorQuickOpenEntry { let input: IResourceInput = { resource: this.resource, options: { - pinned: !this.configurationService.getConfiguration().workbench.quickOpenPreviews + pinned: !this.configurationService.getConfiguration().workbench.editor.enablePreviewFromQuickOpen } };