提交 4161a0dc 编写于 作者: I isidor

workbench: store centered editor layout per wrokspace not per user

fixes #46277
上级 a3489366
...@@ -40,7 +40,6 @@ import { ResourcesDropHandler, LocalSelectionTransfer, DraggedEditorIdentifier } ...@@ -40,7 +40,6 @@ import { ResourcesDropHandler, LocalSelectionTransfer, DraggedEditorIdentifier }
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry'; import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IPartService } from 'vs/workbench/services/part/common/partService'; import { IPartService } from 'vs/workbench/services/part/common/partService';
export enum Rochade { export enum Rochade {
NONE, NONE,
TWO_TO_ONE, TWO_TO_ONE,
...@@ -1062,7 +1061,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro ...@@ -1062,7 +1061,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
this.centeredEditorLeftMarginRatio = 0.5; this.centeredEditorLeftMarginRatio = 0.5;
// Restore centered layout position and size // Restore centered layout position and size
const centeredLayoutDataString = this.storageService.get(EditorGroupsControl.CENTERED_EDITOR_LAYOUT_DATA_STORAGE_KEY, StorageScope.GLOBAL); const centeredLayoutDataString = this.storageService.get(EditorGroupsControl.CENTERED_EDITOR_LAYOUT_DATA_STORAGE_KEY, StorageScope.WORKSPACE);
if (centeredLayoutDataString) { if (centeredLayoutDataString) {
const centeredLayout = <CenteredEditorLayoutData>JSON.parse(centeredLayoutDataString); const centeredLayout = <CenteredEditorLayoutData>JSON.parse(centeredLayoutDataString);
this.centeredEditorLeftMarginRatio = centeredLayout.leftMarginRatio; this.centeredEditorLeftMarginRatio = centeredLayout.leftMarginRatio;
...@@ -1974,7 +1973,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro ...@@ -1974,7 +1973,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
leftMarginRatio: this.centeredEditorLeftMarginRatio, leftMarginRatio: this.centeredEditorLeftMarginRatio,
size: this.centeredEditorSize size: this.centeredEditorSize
}; };
this.storageService.store(EditorGroupsControl.CENTERED_EDITOR_LAYOUT_DATA_STORAGE_KEY, JSON.stringify(data), StorageScope.GLOBAL); this.storageService.store(EditorGroupsControl.CENTERED_EDITOR_LAYOUT_DATA_STORAGE_KEY, JSON.stringify(data), StorageScope.WORKSPACE);
} }
public getVerticalSashTop(sash: Sash): number { public getVerticalSashTop(sash: Sash): number {
...@@ -2219,7 +2218,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro ...@@ -2219,7 +2218,7 @@ export class EditorGroupsControl extends Themable implements IEditorGroupsContro
if (layout) { if (layout) {
this.layoutContainers(); this.layoutContainers();
} }
this.storageService.remove(EditorGroupsControl.CENTERED_EDITOR_LAYOUT_DATA_STORAGE_KEY, StorageScope.GLOBAL); this.storageService.remove(EditorGroupsControl.CENTERED_EDITOR_LAYOUT_DATA_STORAGE_KEY, StorageScope.WORKSPACE);
} }
public getInstantiationService(position: Position): IInstantiationService { public getInstantiationService(position: Position): IInstantiationService {
......
...@@ -405,7 +405,7 @@ export class Workbench implements IPartService { ...@@ -405,7 +405,7 @@ export class Workbench implements IPartService {
} }
// Restore Forced Editor Center Mode // Restore Forced Editor Center Mode
if (this.storageService.getBoolean(Workbench.centeredEditorLayoutActiveStorageKey, StorageScope.GLOBAL, false)) { if (this.storageService.getBoolean(Workbench.centeredEditorLayoutActiveStorageKey, StorageScope.WORKSPACE, false)) {
this.centeredEditorLayoutActive = true; this.centeredEditorLayoutActive = true;
} }
...@@ -1415,7 +1415,7 @@ export class Workbench implements IPartService { ...@@ -1415,7 +1415,7 @@ export class Workbench implements IPartService {
public centerEditorLayout(active: boolean, skipLayout?: boolean): void { public centerEditorLayout(active: boolean, skipLayout?: boolean): void {
this.centeredEditorLayoutActive = active; this.centeredEditorLayoutActive = active;
this.storageService.store(Workbench.centeredEditorLayoutActiveStorageKey, this.centeredEditorLayoutActive, StorageScope.GLOBAL); this.storageService.store(Workbench.centeredEditorLayoutActiveStorageKey, this.centeredEditorLayoutActive, StorageScope.WORKSPACE);
if (!skipLayout) { if (!skipLayout) {
this.layout(); this.layout();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册