Skip to content

Commit 76d430e

Browse files
author
Benjamin Pasero
committed
editor part 💄
1 parent f98bf3c commit 76d430e

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

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

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { Part } from 'vs/workbench/browser/part';
99
import { Dimension, isAncestor, toggleClass, addClass, $, EventHelper, addDisposableGenericMouseDownListner } from 'vs/base/browser/dom';
1010
import { Event, Emitter, Relay } from 'vs/base/common/event';
1111
import { contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
12-
import { GroupDirection, IAddGroupOptions, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, ICopyEditorOptions, GroupsOrder, GroupChangeKind, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
12+
import { GroupDirection, IAddGroupOptions, GroupsArrangement, GroupOrientation, IMergeGroupOptions, MergeGroupMode, GroupsOrder, GroupChangeKind, GroupLocation, IFindGroupScope, EditorGroupLayout, GroupLayoutArgument, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
1313
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
1414
import { IView, orthogonal, LayoutPriority, IViewSize, Direction, SerializableGrid, Sizing, ISerializedGrid, Orientation, GridBranchNode, isGridBranchNode, GridNode, createSerializedGrid, Grid } from 'vs/base/browser/ui/grid/grid';
1515
import { GroupIdentifier, IEditorPartOptions, IEditorPartOptionsChangeEvent } from 'vs/workbench/common/editor';
@@ -123,8 +123,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
123123
private readonly workspaceMemento: MementoObject;
124124
private readonly globalMemento: MementoObject;
125125

126-
private _partOptions: IEditorPartOptions;
127-
128126
private readonly groupViews = new Map<GroupIdentifier, IEditorGroupView>();
129127
private mostRecentActiveGroups: GroupIdentifier[] = [];
130128

@@ -149,8 +147,6 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
149147

150148
this.gridWidgetView = new GridWidgetView<IEditorGroupView>();
151149

152-
this._partOptions = getEditorPartOptions(this.configurationService, this.themeService);
153-
154150
this.workspaceMemento = this.getMemento(StorageScope.WORKSPACE);
155151
this.globalMemento = this.getMemento(StorageScope.GLOBAL);
156152

@@ -187,9 +183,8 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
187183

188184
private enforcedPartOptions: IEditorPartOptions[] = [];
189185

190-
get partOptions(): IEditorPartOptions {
191-
return this._partOptions;
192-
}
186+
private _partOptions = getEditorPartOptions(this.configurationService, this.themeService);
187+
get partOptions(): IEditorPartOptions { return this._partOptions; }
193188

194189
enforcePartOptions(options: IEditorPartOptions): IDisposable {
195190
this.enforcedPartOptions.push(options);
@@ -749,12 +744,12 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
749744
sourceView.editors.forEach(editor => {
750745
const inactive = !sourceView.isActive(editor) || this._activeGroup !== sourceView;
751746
const sticky = sourceView.isSticky(editor);
752-
const copyOptions: ICopyEditorOptions = { index: !sticky ? index : undefined, inactive, preserveFocus: inactive };
747+
const editorOptions = { index: !sticky ? index : undefined /* do not set index to preserve sticky flag */, inactive, preserveFocus: inactive };
753748

754749
if (options?.mode === MergeGroupMode.COPY_EDITORS) {
755-
sourceView.copyEditor(editor, targetView, copyOptions);
750+
sourceView.copyEditor(editor, targetView, editorOptions);
756751
} else {
757-
sourceView.moveEditor(editor, targetView, copyOptions);
752+
sourceView.moveEditor(editor, targetView, editorOptions);
758753
}
759754

760755
index++;

0 commit comments

Comments
 (0)