@codingame/monaco-vscode-views-service-override 1.82.6 → 1.83.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/index-no-csp.html +2 -1
- package/assets/index.html +3 -2
- package/package.json +4 -4
- package/views.js +1 -1
- package/vscode/src/vs/base/browser/ui/grid/gridview.js +31 -12
- package/vscode/src/vs/base/common/codicons.d.ts +1 -1
- package/vscode/src/vs/platform/actions/browser/toolbar.d.ts +7 -2
- package/vscode/src/vs/workbench/api/browser/viewsExtensionPoint.js +2 -1
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarActions.js +26 -28
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.d.ts +4 -2
- package/vscode/src/vs/workbench/browser/parts/activitybar/activitybarPart.js +19 -8
- package/vscode/src/vs/workbench/browser/parts/activitybar/media/activityaction.css.js +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/breadcrumbsControl.js +44 -1
- package/vscode/src/vs/workbench/browser/parts/editor/editorDropTarget.js +18 -18
- package/vscode/src/vs/workbench/browser/parts/editor/editorGroupView.js +82 -91
- package/vscode/src/vs/workbench/browser/parts/editor/editorPart.js +15 -13
- package/vscode/src/vs/workbench/browser/parts/editor/{titleControl.js → editorTabsControl.js} +69 -87
- package/vscode/src/vs/workbench/browser/parts/editor/editorTitleControl.js +152 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/{titlecontrol.css.js → editortabscontrol.css.js} +1 -1
- package/vscode/src/vs/workbench/browser/parts/editor/media/editortitlecontrol.css.js +6 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/multieditortabscontrol.css.js +6 -0
- package/vscode/src/vs/workbench/browser/parts/editor/media/singleeditortabscontrol.css.js +6 -0
- package/vscode/src/vs/workbench/browser/parts/editor/{tabsTitleControl.js → multiEditorTabsControl.js} +265 -252
- package/vscode/src/vs/workbench/browser/parts/editor/multiRowEditorTabsControl.js +152 -0
- package/vscode/src/vs/workbench/browser/parts/editor/{noTabsTitleControl.js → singleEditorTabsControl.js} +39 -31
- package/vscode/src/vs/workbench/browser/parts/views/checkbox.js +1 -0
- package/vscode/src/vs/workbench/browser/parts/views/treeView.js +10 -13
- package/vscode/src/vs/workbench/common/editor/filteredEditorGroupModel.js +109 -0
- package/vscode/src/vs/workbench/contrib/customEditor/common/customEditorModelManager.js +2 -2
- package/vscode/src/vs/workbench/contrib/files/browser/editors/fileEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/remote/browser/tunnelView.js +3 -3
- package/vscode/src/vs/workbench/contrib/webview/browser/themeing.js +2 -2
- package/vscode/src/vs/workbench/contrib/webview/browser/webviewElement.js +1 -1
- package/vscode/src/vs/workbench/services/history/browser/historyService.js +11 -0
- package/vscode/src/vs/workbench/services/userDataProfile/common/userDataProfileIcons.js +7 -0
- package/vscode/src/vs/workbench/services/views/browser/viewDescriptorService.js +15 -8
- package/vscode/src/vs/workbench/services/views/common/viewContainerModel.js +9 -14
- package/vscode/src/vs/workbench/browser/parts/editor/media/notabstitlecontrol.css.js +0 -6
- package/vscode/src/vs/workbench/browser/parts/editor/media/tabstitlecontrol.css.js +0 -6
|
@@ -34,9 +34,9 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
34
34
|
static { DropOverlay_1 = this; }
|
|
35
35
|
static { this.OVERLAY_ID = 'monaco-workbench-editor-drop-overlay'; }
|
|
36
36
|
get disposed() { return !!this._disposed; }
|
|
37
|
-
constructor(
|
|
37
|
+
constructor(groupsView, groupView, themeService, configurationService, instantiationService, editorService, editorGroupService, treeViewsDragAndDropService, contextService) {
|
|
38
38
|
super(themeService);
|
|
39
|
-
this.
|
|
39
|
+
this.groupsView = groupsView;
|
|
40
40
|
this.groupView = groupView;
|
|
41
41
|
this.configurationService = configurationService;
|
|
42
42
|
this.instantiationService = instantiationService;
|
|
@@ -163,13 +163,13 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
163
163
|
if (this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype)) {
|
|
164
164
|
const data = this.groupTransfer.getData(DraggedEditorGroupIdentifier.prototype);
|
|
165
165
|
if (Array.isArray(data)) {
|
|
166
|
-
return this.
|
|
166
|
+
return this.groupsView.getGroup(data[0].identifier);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
else if (this.editorTransfer.hasData(DraggedEditorIdentifier.prototype)) {
|
|
170
170
|
const data = this.editorTransfer.getData(DraggedEditorIdentifier.prototype);
|
|
171
171
|
if (Array.isArray(data)) {
|
|
172
|
-
return this.
|
|
172
|
+
return this.groupsView.getGroup(data[0].identifier.groupId);
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
return undefined;
|
|
@@ -178,7 +178,7 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
178
178
|
const ensureTargetGroup = () => {
|
|
179
179
|
let targetGroup;
|
|
180
180
|
if (typeof splitDirection === 'number') {
|
|
181
|
-
targetGroup = this.
|
|
181
|
+
targetGroup = this.groupsView.addGroup(this.groupView, splitDirection);
|
|
182
182
|
}
|
|
183
183
|
else {
|
|
184
184
|
targetGroup = this.groupView;
|
|
@@ -188,7 +188,7 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
188
188
|
if (this.groupTransfer.hasData(DraggedEditorGroupIdentifier.prototype)) {
|
|
189
189
|
const data = this.groupTransfer.getData(DraggedEditorGroupIdentifier.prototype);
|
|
190
190
|
if (Array.isArray(data)) {
|
|
191
|
-
const sourceGroup = this.
|
|
191
|
+
const sourceGroup = this.groupsView.getGroup(data[0].identifier);
|
|
192
192
|
if (sourceGroup) {
|
|
193
193
|
if (typeof splitDirection !== 'number' && sourceGroup === this.groupView) {
|
|
194
194
|
return;
|
|
@@ -196,10 +196,10 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
196
196
|
let targetGroup;
|
|
197
197
|
if (typeof splitDirection === 'number') {
|
|
198
198
|
if (this.isCopyOperation(event)) {
|
|
199
|
-
targetGroup = this.
|
|
199
|
+
targetGroup = this.groupsView.copyGroup(sourceGroup, this.groupView, splitDirection);
|
|
200
200
|
}
|
|
201
201
|
else {
|
|
202
|
-
targetGroup = this.
|
|
202
|
+
targetGroup = this.groupsView.moveGroup(sourceGroup, this.groupView, splitDirection);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
else {
|
|
@@ -207,10 +207,10 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
207
207
|
if (this.isCopyOperation(event)) {
|
|
208
208
|
mergeGroupOptions = { mode: 0 };
|
|
209
209
|
}
|
|
210
|
-
this.
|
|
210
|
+
this.groupsView.mergeGroup(sourceGroup, this.groupView, mergeGroupOptions);
|
|
211
211
|
}
|
|
212
212
|
if (targetGroup) {
|
|
213
|
-
this.
|
|
213
|
+
this.groupsView.activateGroup(targetGroup);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
this.groupTransfer.clearData(DraggedEditorGroupIdentifier.prototype);
|
|
@@ -220,12 +220,12 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
220
220
|
const data = this.editorTransfer.getData(DraggedEditorIdentifier.prototype);
|
|
221
221
|
if (Array.isArray(data)) {
|
|
222
222
|
const draggedEditor = data[0].identifier;
|
|
223
|
-
const sourceGroup = this.
|
|
223
|
+
const sourceGroup = this.groupsView.getGroup(draggedEditor.groupId);
|
|
224
224
|
if (sourceGroup) {
|
|
225
225
|
const copyEditor = this.isCopyOperation(event, draggedEditor);
|
|
226
226
|
let targetGroup = undefined;
|
|
227
227
|
if (this.editorGroupService.partOptions.closeEmptyGroups && sourceGroup.count === 1 && typeof splitDirection === 'number' && !copyEditor) {
|
|
228
|
-
targetGroup = this.
|
|
228
|
+
targetGroup = this.groupsView.moveGroup(sourceGroup, this.groupView, splitDirection);
|
|
229
229
|
}
|
|
230
230
|
else {
|
|
231
231
|
targetGroup = ensureTargetGroup();
|
|
@@ -280,7 +280,7 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
280
280
|
return (e.altKey && !isMacintosh) || (e.shiftKey && isMacintosh);
|
|
281
281
|
}
|
|
282
282
|
positionOverlay(mousePosX, mousePosY, isDraggingGroup, enableSplitting) {
|
|
283
|
-
const preferSplitVertically = this.
|
|
283
|
+
const preferSplitVertically = this.groupsView.partOptions.openSideBySideDirection === 'right';
|
|
284
284
|
const editorControlWidth = this.groupView.element.clientWidth;
|
|
285
285
|
const editorControlHeight = this.groupView.element.clientHeight - this.getOverlayOffsetHeight();
|
|
286
286
|
let edgeWidthThresholdFactor;
|
|
@@ -383,7 +383,7 @@ let DropOverlay = class DropOverlay extends Themable {
|
|
|
383
383
|
overlay.style.height = options.height;
|
|
384
384
|
}
|
|
385
385
|
getOverlayOffsetHeight() {
|
|
386
|
-
if (!this.groupView.isEmpty && this.
|
|
386
|
+
if (!this.groupView.isEmpty && this.groupsView.partOptions.showTabs) {
|
|
387
387
|
return this.groupView.titleHeight.offset;
|
|
388
388
|
}
|
|
389
389
|
return 0;
|
|
@@ -419,9 +419,9 @@ DropOverlay = DropOverlay_1 = ( __decorate([
|
|
|
419
419
|
( __param(8, IWorkspaceContextService))
|
|
420
420
|
], DropOverlay));
|
|
421
421
|
let EditorDropTarget = class EditorDropTarget extends Themable {
|
|
422
|
-
constructor(
|
|
422
|
+
constructor(groupsView, container, delegate, themeService, configurationService, instantiationService) {
|
|
423
423
|
super(themeService);
|
|
424
|
-
this.
|
|
424
|
+
this.groupsView = groupsView;
|
|
425
425
|
this.container = container;
|
|
426
426
|
this.delegate = delegate;
|
|
427
427
|
this.configurationService = configurationService;
|
|
@@ -466,7 +466,7 @@ let EditorDropTarget = class EditorDropTarget extends Themable {
|
|
|
466
466
|
if (!this.overlay) {
|
|
467
467
|
const targetGroupView = this.findTargetGroupView(target);
|
|
468
468
|
if (targetGroupView) {
|
|
469
|
-
this._overlay = this.instantiationService.createInstance(DropOverlay, this.
|
|
469
|
+
this._overlay = this.instantiationService.createInstance(DropOverlay, this.groupsView, targetGroupView);
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
472
|
}
|
|
@@ -483,7 +483,7 @@ let EditorDropTarget = class EditorDropTarget extends Themable {
|
|
|
483
483
|
this.disposeOverlay();
|
|
484
484
|
}
|
|
485
485
|
findTargetGroupView(child) {
|
|
486
|
-
const groups = this.
|
|
486
|
+
const groups = this.groupsView.groups;
|
|
487
487
|
return groups.find(groupView => isAncestor(child, groupView.element) || this.delegate.containsGroup?.(groupView));
|
|
488
488
|
}
|
|
489
489
|
updateContainer(isDraggedOver) {
|
|
@@ -2,18 +2,17 @@ import { __decorate, __param } from '../../../../../../../external/tslib/tslib.e
|
|
|
2
2
|
import './media/editorgroupview.css.js';
|
|
3
3
|
import { isSerializedEditorGroupModel, EditorGroupModel, isGroupEditorCloseEvent, isGroupEditorOpenEvent } from 'vscode/vscode/vs/workbench/common/editor/editorGroupModel';
|
|
4
4
|
import { DEFAULT_EDITOR_ASSOCIATION, SideBySideEditor, EditorResourceAccessor, EditorCloseContext } from 'vscode/vscode/vs/workbench/common/editor';
|
|
5
|
-
import { ActiveEditorDirtyContext, ActiveEditorPinnedContext, ActiveEditorFirstInGroupContext, ActiveEditorLastInGroupContext, ActiveEditorStickyContext, EditorGroupEditorsCountContext, ActiveEditorGroupLockedContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
5
|
+
import { ActiveEditorDirtyContext, ActiveEditorPinnedContext, ActiveEditorFirstInGroupContext, ActiveEditorLastInGroupContext, ActiveEditorStickyContext, EditorGroupEditorsCountContext, ActiveEditorGroupLockedContext, EditorPinnedAndUnpinnedTabsContext } from 'vscode/vscode/vs/workbench/common/contextkeys';
|
|
6
6
|
import { SideBySideEditorInput } from 'vscode/vscode/vs/workbench/common/editor/sideBySideEditorInput';
|
|
7
7
|
import { Emitter, Relay } from 'monaco-editor/esm/vs/base/common/event.js';
|
|
8
8
|
import { IInstantiationService } from 'monaco-editor/esm/vs/platform/instantiation/common/instantiation.js';
|
|
9
|
-
import { addDisposableListener, EventType, EventHelper, trackFocus,
|
|
9
|
+
import { addDisposableListener, EventType, EventHelper, trackFocus, isAncestor, Dimension, findParentWithClass } from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
10
10
|
import { ServiceCollection } from 'monaco-editor/esm/vs/platform/instantiation/common/serviceCollection.js';
|
|
11
11
|
import { IContextKeyService } from 'monaco-editor/esm/vs/platform/contextkey/common/contextkey.js';
|
|
12
12
|
import { ProgressBar } from 'monaco-editor/esm/vs/base/browser/ui/progressbar/progressbar.js';
|
|
13
13
|
import { Themable, IThemeService } from 'monaco-editor/esm/vs/platform/theme/common/themeService.js';
|
|
14
14
|
import { contrastBorder, editorBackground } from 'monaco-editor/esm/vs/platform/theme/common/colorRegistry.js';
|
|
15
15
|
import { EDITOR_GROUP_EMPTY_BACKGROUND, EDITOR_GROUP_HEADER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND } from 'vscode/vscode/vs/workbench/common/theme';
|
|
16
|
-
import { TabsTitleControl } from './tabsTitleControl.js';
|
|
17
16
|
import { EditorPanes } from './editorPanes.js';
|
|
18
17
|
import { IEditorProgressService } from 'monaco-editor/esm/vs/platform/progress/common/progress.js';
|
|
19
18
|
import { EditorProgressIndicator } from 'vscode/vscode/vs/workbench/services/progress/browser/progressIndicator';
|
|
@@ -26,7 +25,6 @@ import { EventType as EventType$1 } from 'monaco-editor/esm/vs/base/browser/touc
|
|
|
26
25
|
import { fillActiveEditorViewState } from 'vscode/vscode/vs/workbench/browser/parts/editor/editor';
|
|
27
26
|
import { ActionBar } from 'monaco-editor/esm/vs/base/browser/ui/actionbar/actionbar.js';
|
|
28
27
|
import { IKeybindingService } from 'monaco-editor/esm/vs/platform/keybinding/common/keybinding.js';
|
|
29
|
-
import { NoTabsTitleControl } from './noTabsTitleControl.js';
|
|
30
28
|
import { MenuId, IMenuService } from 'monaco-editor/esm/vs/platform/actions/common/actions.js';
|
|
31
29
|
import { StandardMouseEvent } from 'monaco-editor/esm/vs/base/browser/mouseEvent.js';
|
|
32
30
|
import { createAndFillInActionBarActions } from 'monaco-editor/esm/vs/platform/actions/browser/menuEntryActionViewItem.js';
|
|
@@ -45,22 +43,23 @@ import { ILogService } from 'monaco-editor/esm/vs/platform/log/common/log.js';
|
|
|
45
43
|
import { TelemetryTrustedValue } from 'vscode/vscode/vs/platform/telemetry/common/telemetryUtils';
|
|
46
44
|
import { defaultProgressBarStyles } from 'monaco-editor/esm/vs/platform/theme/browser/defaultStyles.js';
|
|
47
45
|
import { EditorGroupWatermark } from './editorGroupWatermark.js';
|
|
46
|
+
import { EditorTitleControl } from './editorTitleControl.js';
|
|
48
47
|
import { IFileDialogService } from 'vscode/vscode/vs/platform/dialogs/common/dialogs';
|
|
49
48
|
|
|
50
49
|
var EditorGroupView_1;
|
|
51
50
|
let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable {
|
|
52
|
-
static createNew(
|
|
53
|
-
return instantiationService.createInstance(EditorGroupView_1,
|
|
51
|
+
static createNew(groupsView, index, instantiationService) {
|
|
52
|
+
return instantiationService.createInstance(EditorGroupView_1, groupsView, null, index);
|
|
54
53
|
}
|
|
55
|
-
static createFromSerialized(serialized,
|
|
56
|
-
return instantiationService.createInstance(EditorGroupView_1,
|
|
54
|
+
static createFromSerialized(serialized, groupsView, index, instantiationService) {
|
|
55
|
+
return instantiationService.createInstance(EditorGroupView_1, groupsView, serialized, index);
|
|
57
56
|
}
|
|
58
|
-
static createCopy(copyFrom,
|
|
59
|
-
return instantiationService.createInstance(EditorGroupView_1,
|
|
57
|
+
static createCopy(copyFrom, groupsView, index, instantiationService) {
|
|
58
|
+
return instantiationService.createInstance(EditorGroupView_1, groupsView, copyFrom, index);
|
|
60
59
|
}
|
|
61
|
-
constructor(
|
|
60
|
+
constructor(groupsView, from, _index, instantiationService, contextKeyService, themeService, telemetryService, keybindingService, menuService, contextMenuService, fileDialogService, editorService, filesConfigurationService, uriIdentityService, logService) {
|
|
62
61
|
super(themeService);
|
|
63
|
-
this.
|
|
62
|
+
this.groupsView = groupsView;
|
|
64
63
|
this._index = _index;
|
|
65
64
|
this.instantiationService = instantiationService;
|
|
66
65
|
this.contextKeyService = contextKeyService;
|
|
@@ -126,7 +125,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
126
125
|
this.titleContainer = document.createElement('div');
|
|
127
126
|
this.titleContainer.classList.add('title');
|
|
128
127
|
this.element.appendChild(this.titleContainer);
|
|
129
|
-
this.
|
|
128
|
+
this.titleControl = this._register(this.scopedInstantiationService.createInstance(EditorTitleControl, this.titleContainer, this.groupsView, this, this.model));
|
|
130
129
|
this.editorContainer = document.createElement('div');
|
|
131
130
|
this.editorContainer.classList.add('editor-container');
|
|
132
131
|
this.element.appendChild(this.editorContainer);
|
|
@@ -151,6 +150,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
151
150
|
const groupActiveEditorStickyContext = ActiveEditorStickyContext.bindTo(this.scopedContextKeyService);
|
|
152
151
|
const groupEditorsCountContext = EditorGroupEditorsCountContext.bindTo(this.scopedContextKeyService);
|
|
153
152
|
const groupLockedContext = ActiveEditorGroupLockedContext.bindTo(this.scopedContextKeyService);
|
|
153
|
+
const groupHasPinnedAndUnpinnedContext = EditorPinnedAndUnpinnedTabsContext.bindTo(this.scopedContextKeyService);
|
|
154
154
|
const activeEditorListener = this._register(( new MutableDisposable()));
|
|
155
155
|
const observeActiveEditor = () => {
|
|
156
156
|
activeEditorListener.clear();
|
|
@@ -170,9 +170,10 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
170
170
|
case 2 :
|
|
171
171
|
groupLockedContext.set(this.isLocked);
|
|
172
172
|
break;
|
|
173
|
-
case 6 :
|
|
174
173
|
case 4 :
|
|
175
174
|
case 3 :
|
|
175
|
+
groupHasPinnedAndUnpinnedContext.set(this.hasPinnedAndUnpinnedEditors());
|
|
176
|
+
case 6 :
|
|
176
177
|
case 5 :
|
|
177
178
|
groupActiveEditorFirstContext.set(this.model.isFirst(this.model.activeEditor));
|
|
178
179
|
groupActiveEditorLastContext.set(this.model.isLast(this.model.activeEditor));
|
|
@@ -186,6 +187,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
186
187
|
if (e.editor && e.editor === this.model.activeEditor) {
|
|
187
188
|
groupActiveEditorStickyContext.set(this.model.isSticky(this.model.activeEditor));
|
|
188
189
|
}
|
|
190
|
+
groupHasPinnedAndUnpinnedContext.set(this.hasPinnedAndUnpinnedEditors());
|
|
189
191
|
break;
|
|
190
192
|
}
|
|
191
193
|
groupEditorsCountContext.set(this.count);
|
|
@@ -194,6 +196,10 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
194
196
|
observeActiveEditor();
|
|
195
197
|
}));
|
|
196
198
|
observeActiveEditor();
|
|
199
|
+
groupHasPinnedAndUnpinnedContext.set(this.hasPinnedAndUnpinnedEditors());
|
|
200
|
+
}
|
|
201
|
+
hasPinnedAndUnpinnedEditors() {
|
|
202
|
+
return this.model.stickyCount > 0 && this.model.stickyCount < this.model.count;
|
|
197
203
|
}
|
|
198
204
|
registerContainerListeners() {
|
|
199
205
|
this._register(addDisposableListener(this.element, EventType.DBLCLICK, e => {
|
|
@@ -211,7 +217,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
211
217
|
this._register(addDisposableListener(this.element, EventType.AUXCLICK, e => {
|
|
212
218
|
if (this.isEmpty && e.button === 1 ) {
|
|
213
219
|
EventHelper.stop(e, true);
|
|
214
|
-
this.
|
|
220
|
+
this.groupsView.removeGroup(this);
|
|
215
221
|
}
|
|
216
222
|
}));
|
|
217
223
|
}
|
|
@@ -302,21 +308,8 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
302
308
|
this.updateStyles();
|
|
303
309
|
}
|
|
304
310
|
updateTitleContainer() {
|
|
305
|
-
this.titleContainer.classList.toggle('tabs', this.
|
|
306
|
-
this.titleContainer.classList.toggle('show-file-icons', this.
|
|
307
|
-
}
|
|
308
|
-
createTitleAreaControl() {
|
|
309
|
-
if (this.titleAreaControl) {
|
|
310
|
-
this.titleAreaControl.dispose();
|
|
311
|
-
clearNode(this.titleContainer);
|
|
312
|
-
}
|
|
313
|
-
if (this.accessor.partOptions.showTabs) {
|
|
314
|
-
this.titleAreaControl = this.scopedInstantiationService.createInstance(TabsTitleControl, this.titleContainer, this.accessor, this);
|
|
315
|
-
}
|
|
316
|
-
else {
|
|
317
|
-
this.titleAreaControl = this.scopedInstantiationService.createInstance(NoTabsTitleControl, this.titleContainer, this.accessor, this);
|
|
318
|
-
}
|
|
319
|
-
return this.titleAreaControl;
|
|
311
|
+
this.titleContainer.classList.toggle('tabs', this.groupsView.partOptions.showTabs);
|
|
312
|
+
this.titleContainer.classList.toggle('show-file-icons', this.groupsView.partOptions.showIcons);
|
|
320
313
|
}
|
|
321
314
|
restoreEditors(from) {
|
|
322
315
|
if (this.count === 0) {
|
|
@@ -338,15 +331,15 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
338
331
|
options.preserveFocus = true;
|
|
339
332
|
const activeElement = document.activeElement;
|
|
340
333
|
return this.doShowEditor(activeEditor, { active: true, isNew: false }, options).then(() => {
|
|
341
|
-
if (this.
|
|
334
|
+
if (this.groupsView.activeGroup === this && activeElement === document.activeElement) {
|
|
342
335
|
this.focus();
|
|
343
336
|
}
|
|
344
337
|
});
|
|
345
338
|
}
|
|
346
339
|
registerListeners() {
|
|
347
340
|
this._register(this.model.onDidModelChange(e => this.onDidGroupModelChange(e)));
|
|
348
|
-
this._register(this.
|
|
349
|
-
this._register(this.
|
|
341
|
+
this._register(this.groupsView.onDidChangeEditorPartOptions(e => this.onDidChangeEditorPartOptions(e)));
|
|
342
|
+
this._register(this.groupsView.onDidVisibilityChange(e => this.onDidVisibilityChange(e)));
|
|
350
343
|
}
|
|
351
344
|
onDidGroupModelChange(e) {
|
|
352
345
|
this._onDidModelChange.fire(e);
|
|
@@ -395,7 +388,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
395
388
|
this._onDidCloseEditor.fire({ groupId: this.id, editor, context, index: editorIndex, sticky });
|
|
396
389
|
}
|
|
397
390
|
canDispose(editor) {
|
|
398
|
-
for (const groupView of this.
|
|
391
|
+
for (const groupView of this.groupsView.groups) {
|
|
399
392
|
if (groupView instanceof EditorGroupView_1 && groupView.model.contains(editor, {
|
|
400
393
|
strictEquals: true,
|
|
401
394
|
supportSideBySide: SideBySideEditor.ANY
|
|
@@ -449,16 +442,14 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
449
442
|
}
|
|
450
443
|
onDidChangeEditorPartOptions(event) {
|
|
451
444
|
this.updateTitleContainer();
|
|
452
|
-
|
|
453
|
-
|
|
445
|
+
this.titleControl.updateOptions(event.oldPartOptions, event.newPartOptions);
|
|
446
|
+
if (event.oldPartOptions.showTabs !== event.newPartOptions.showTabs ||
|
|
447
|
+
(event.oldPartOptions.showTabs && event.oldPartOptions.pinnedTabsOnSeparateRow !== event.newPartOptions.pinnedTabsOnSeparateRow)) {
|
|
454
448
|
this.relayout();
|
|
455
449
|
if (this.model.activeEditor) {
|
|
456
|
-
this.
|
|
450
|
+
this.titleControl.openEditor(this.model.activeEditor);
|
|
457
451
|
}
|
|
458
452
|
}
|
|
459
|
-
else {
|
|
460
|
-
this.titleAreaControl.updateOptions(event.oldPartOptions, event.newPartOptions);
|
|
461
|
-
}
|
|
462
453
|
this.updateStyles();
|
|
463
454
|
if (event.oldPartOptions.enablePreview && !event.newPartOptions.enablePreview) {
|
|
464
455
|
if (this.model.previewEditor) {
|
|
@@ -468,10 +459,10 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
468
459
|
}
|
|
469
460
|
onDidChangeEditorDirty(editor) {
|
|
470
461
|
this.pinEditor(editor);
|
|
471
|
-
this.
|
|
462
|
+
this.titleControl.updateEditorDirty(editor);
|
|
472
463
|
}
|
|
473
464
|
onDidChangeEditorLabel(editor) {
|
|
474
|
-
this.
|
|
465
|
+
this.titleControl.updateEditorLabel(editor);
|
|
475
466
|
}
|
|
476
467
|
onDidVisibilityChange(visible) {
|
|
477
468
|
this.editorPane.setVisible(visible);
|
|
@@ -492,7 +483,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
492
483
|
return this.count === 0;
|
|
493
484
|
}
|
|
494
485
|
get titleHeight() {
|
|
495
|
-
return this.
|
|
486
|
+
return this.titleControl.getHeight();
|
|
496
487
|
}
|
|
497
488
|
notifyIndexChanged(newIndex) {
|
|
498
489
|
if (this._index !== newIndex) {
|
|
@@ -504,7 +495,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
504
495
|
this.active = isActive;
|
|
505
496
|
this.element.classList.toggle('active', isActive);
|
|
506
497
|
this.element.classList.toggle('inactive', !isActive);
|
|
507
|
-
this.
|
|
498
|
+
this.titleControl.setActive(isActive);
|
|
508
499
|
this.updateStyles();
|
|
509
500
|
this.model.setActive(undefined );
|
|
510
501
|
}
|
|
@@ -590,7 +581,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
590
581
|
if (candidate && !this.model.isPinned(candidate)) {
|
|
591
582
|
const editor = this.model.pin(candidate);
|
|
592
583
|
if (editor) {
|
|
593
|
-
this.
|
|
584
|
+
this.titleControl.pinEditor(editor);
|
|
594
585
|
}
|
|
595
586
|
}
|
|
596
587
|
}
|
|
@@ -609,18 +600,19 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
609
600
|
}
|
|
610
601
|
const newIndexOfEditor = this.getIndexOfEditor(editor);
|
|
611
602
|
if (newIndexOfEditor !== oldIndexOfEditor) {
|
|
612
|
-
this.
|
|
603
|
+
this.titleControl.moveEditor(editor, oldIndexOfEditor, newIndexOfEditor, true);
|
|
613
604
|
}
|
|
614
605
|
if (sticky) {
|
|
615
|
-
this.
|
|
606
|
+
this.titleControl.stickEditor(editor);
|
|
616
607
|
}
|
|
617
608
|
else {
|
|
618
|
-
this.
|
|
609
|
+
this.titleControl.unstickEditor(editor);
|
|
619
610
|
}
|
|
620
611
|
}
|
|
621
612
|
}
|
|
622
|
-
async openEditor(editor, options) {
|
|
613
|
+
async openEditor(editor, options, internalOptions) {
|
|
623
614
|
return this.doOpenEditor(editor, options, {
|
|
615
|
+
...internalOptions,
|
|
624
616
|
supportSideBySide: SideBySideEditor.BOTH
|
|
625
617
|
});
|
|
626
618
|
}
|
|
@@ -630,7 +622,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
630
622
|
}
|
|
631
623
|
this._onWillOpenEditor.fire({ editor, groupId: this.id });
|
|
632
624
|
const pinned = options?.sticky
|
|
633
|
-
|| !this.
|
|
625
|
+
|| !this.groupsView.partOptions.enablePreview
|
|
634
626
|
|| editor.isDirty()
|
|
635
627
|
|| ((options?.pinned ?? typeof options?.index === 'number') )
|
|
636
628
|
|| (typeof options?.index === 'number' && this.model.isSticky(options.index))
|
|
@@ -642,9 +634,6 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
642
634
|
active: this.count === 0 || !options || !options.inactive,
|
|
643
635
|
supportSideBySide: internalOptions?.supportSideBySide
|
|
644
636
|
};
|
|
645
|
-
if (options?.sticky && typeof options?.index === 'number' && !this.model.isSticky(options.index)) {
|
|
646
|
-
openEditorOptions.sticky = false;
|
|
647
|
-
}
|
|
648
637
|
if (!openEditorOptions.active && !openEditorOptions.pinned && this.model.activeEditor && !this.model.isPinned(this.model.activeEditor)) {
|
|
649
638
|
openEditorOptions.active = true;
|
|
650
639
|
}
|
|
@@ -673,18 +662,18 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
673
662
|
const { editor: openedEditor, isNew } = this.model.openEditor(editor, openEditorOptions);
|
|
674
663
|
if (isNew &&
|
|
675
664
|
this.count === 1 &&
|
|
676
|
-
this.
|
|
665
|
+
this.groupsView.groups.length > 1
|
|
677
666
|
) {
|
|
678
|
-
if (openedEditor.editorId && this.
|
|
667
|
+
if (openedEditor.editorId && this.groupsView.partOptions.autoLockGroups?.has(openedEditor.editorId)) {
|
|
679
668
|
this.lock(true);
|
|
680
669
|
}
|
|
681
670
|
}
|
|
682
671
|
const showEditorResult = this.doShowEditor(openedEditor, { active: !!openEditorOptions.active, isNew }, options, internalOptions);
|
|
683
672
|
if (activateGroup) {
|
|
684
|
-
this.
|
|
673
|
+
this.groupsView.activateGroup(this);
|
|
685
674
|
}
|
|
686
675
|
else if (restoreGroup) {
|
|
687
|
-
this.
|
|
676
|
+
this.groupsView.restoreGroup(this);
|
|
688
677
|
}
|
|
689
678
|
return showEditorResult;
|
|
690
679
|
}
|
|
@@ -713,7 +702,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
713
702
|
openEditorPromise = Promise.resolve(undefined);
|
|
714
703
|
}
|
|
715
704
|
if (!internalOptions?.skipTitleUpdate) {
|
|
716
|
-
this.
|
|
705
|
+
this.titleControl.openEditor(editor, internalOptions);
|
|
717
706
|
}
|
|
718
707
|
return openEditorPromise;
|
|
719
708
|
}
|
|
@@ -740,7 +729,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
740
729
|
skipTitleUpdate: true
|
|
741
730
|
});
|
|
742
731
|
})));
|
|
743
|
-
this.
|
|
732
|
+
this.titleControl.openEditors(( inactiveEditors.map(({ editor }) => editor)));
|
|
744
733
|
return this.editorPane.activeEditorPane ?? undefined;
|
|
745
734
|
}
|
|
746
735
|
moveEditors(editors, target) {
|
|
@@ -752,8 +741,8 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
752
741
|
}
|
|
753
742
|
if (internalOptions.skipTitleUpdate) {
|
|
754
743
|
const movedEditors = ( editors.map(({ editor }) => editor));
|
|
755
|
-
target.
|
|
756
|
-
this.
|
|
744
|
+
target.titleControl.openEditors(movedEditors);
|
|
745
|
+
this.titleControl.closeEditors(movedEditors);
|
|
757
746
|
}
|
|
758
747
|
}
|
|
759
748
|
moveEditor(editor, target, options, internalOptions) {
|
|
@@ -770,24 +759,27 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
770
759
|
return;
|
|
771
760
|
}
|
|
772
761
|
const currentIndex = this.model.indexOf(candidate);
|
|
773
|
-
if (currentIndex === -1 || currentIndex === moveToIndex) {
|
|
774
|
-
return;
|
|
775
|
-
}
|
|
776
762
|
const editor = this.model.getEditorByIndex(currentIndex);
|
|
777
763
|
if (!editor) {
|
|
778
764
|
return;
|
|
779
765
|
}
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
766
|
+
if (currentIndex !== moveToIndex) {
|
|
767
|
+
const oldStickyCount = this.model.stickyCount;
|
|
768
|
+
this.model.moveEditor(editor, moveToIndex);
|
|
769
|
+
this.model.pin(editor);
|
|
770
|
+
this.titleControl.moveEditor(editor, currentIndex, moveToIndex, oldStickyCount !== this.model.stickyCount);
|
|
771
|
+
this.titleControl.pinEditor(editor);
|
|
772
|
+
}
|
|
773
|
+
if (options?.sticky) {
|
|
774
|
+
this.stickEditor(editor);
|
|
775
|
+
}
|
|
784
776
|
}
|
|
785
777
|
doMoveOrCopyEditorAcrossGroups(editor, target, openOptions, internalOptions) {
|
|
786
778
|
const keepCopy = internalOptions?.keepCopy;
|
|
787
779
|
const options = fillActiveEditorViewState(this, editor, {
|
|
788
780
|
...openOptions,
|
|
789
781
|
pinned: true,
|
|
790
|
-
sticky: !keepCopy && this.model.isSticky(editor)
|
|
782
|
+
sticky: openOptions?.sticky ?? (!keepCopy && this.model.isSticky(editor))
|
|
791
783
|
});
|
|
792
784
|
if (!keepCopy) {
|
|
793
785
|
this._onWillMoveEditor.fire({
|
|
@@ -810,7 +802,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
810
802
|
}
|
|
811
803
|
if (internalOptions.skipTitleUpdate) {
|
|
812
804
|
const copiedEditors = ( editors.map(({ editor }) => editor));
|
|
813
|
-
target.
|
|
805
|
+
target.titleControl.openEditors(copiedEditors);
|
|
814
806
|
}
|
|
815
807
|
}
|
|
816
808
|
copyEditor(editor, target, options, internalOptions) {
|
|
@@ -835,9 +827,9 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
835
827
|
this.doCloseEditor(editor, options?.preserveFocus ? false : undefined, internalOptions);
|
|
836
828
|
return true;
|
|
837
829
|
}
|
|
838
|
-
doCloseEditor(editor, focusNext = (this.
|
|
830
|
+
doCloseEditor(editor, focusNext = (this.groupsView.activeGroup === this), internalOptions) {
|
|
839
831
|
if (!internalOptions?.skipTitleUpdate) {
|
|
840
|
-
this.
|
|
832
|
+
this.titleControl.beforeCloseEditor(editor);
|
|
841
833
|
}
|
|
842
834
|
if (this.model.isActive(editor)) {
|
|
843
835
|
this.doCloseActiveEditor(focusNext, internalOptions);
|
|
@@ -846,22 +838,22 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
846
838
|
this.doCloseInactiveEditor(editor, internalOptions);
|
|
847
839
|
}
|
|
848
840
|
if (!internalOptions?.skipTitleUpdate) {
|
|
849
|
-
this.
|
|
841
|
+
this.titleControl.closeEditor(editor);
|
|
850
842
|
}
|
|
851
843
|
}
|
|
852
|
-
doCloseActiveEditor(focusNext = (this.
|
|
844
|
+
doCloseActiveEditor(focusNext = (this.groupsView.activeGroup === this), internalOptions) {
|
|
853
845
|
const editorToClose = this.activeEditor;
|
|
854
846
|
const restoreFocus = this.shouldRestoreFocus(this.element);
|
|
855
|
-
const closeEmptyGroup = this.
|
|
847
|
+
const closeEmptyGroup = this.groupsView.partOptions.closeEmptyGroups;
|
|
856
848
|
if (closeEmptyGroup && this.active && this.count === 1) {
|
|
857
|
-
const mostRecentlyActiveGroups = this.
|
|
849
|
+
const mostRecentlyActiveGroups = this.groupsView.getGroups(1 );
|
|
858
850
|
const nextActiveGroup = mostRecentlyActiveGroups[1];
|
|
859
851
|
if (nextActiveGroup) {
|
|
860
852
|
if (restoreFocus) {
|
|
861
853
|
nextActiveGroup.focus();
|
|
862
854
|
}
|
|
863
855
|
else {
|
|
864
|
-
this.
|
|
856
|
+
this.groupsView.activateGroup(nextActiveGroup);
|
|
865
857
|
}
|
|
866
858
|
}
|
|
867
859
|
}
|
|
@@ -872,7 +864,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
872
864
|
if (nextActiveEditor) {
|
|
873
865
|
const preserveFocus = !focusNext;
|
|
874
866
|
let activation = undefined;
|
|
875
|
-
if (preserveFocus && this.
|
|
867
|
+
if (preserveFocus && this.groupsView.activeGroup !== this) {
|
|
876
868
|
activation = EditorActivation.PRESERVE;
|
|
877
869
|
}
|
|
878
870
|
const options = {
|
|
@@ -891,7 +883,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
891
883
|
}
|
|
892
884
|
this._onDidActiveEditorChange.fire({ editor: undefined });
|
|
893
885
|
if (closeEmptyGroup) {
|
|
894
|
-
this.
|
|
886
|
+
this.groupsView.removeGroup(this);
|
|
895
887
|
}
|
|
896
888
|
}
|
|
897
889
|
}
|
|
@@ -934,7 +926,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
934
926
|
if (editor instanceof SideBySideEditorInput && this.model.contains(editor.primary)) {
|
|
935
927
|
return false;
|
|
936
928
|
}
|
|
937
|
-
if (( this.
|
|
929
|
+
if (( this.groupsView.groups.some(groupView => {
|
|
938
930
|
if (groupView === this) {
|
|
939
931
|
return false;
|
|
940
932
|
}
|
|
@@ -1059,13 +1051,13 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
1059
1051
|
this.doCloseActiveEditor(options?.preserveFocus ? false : undefined);
|
|
1060
1052
|
}
|
|
1061
1053
|
if (editors.length) {
|
|
1062
|
-
this.
|
|
1054
|
+
this.titleControl.closeEditors(editors);
|
|
1063
1055
|
}
|
|
1064
1056
|
}
|
|
1065
1057
|
async closeAllEditors(options) {
|
|
1066
1058
|
if (this.isEmpty) {
|
|
1067
|
-
if (this.
|
|
1068
|
-
this.
|
|
1059
|
+
if (this.groupsView.partOptions.closeEmptyGroups) {
|
|
1060
|
+
this.groupsView.removeGroup(this);
|
|
1069
1061
|
}
|
|
1070
1062
|
return true;
|
|
1071
1063
|
}
|
|
@@ -1088,7 +1080,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
1088
1080
|
this.doCloseActiveEditor();
|
|
1089
1081
|
}
|
|
1090
1082
|
if (editorsToClose.length) {
|
|
1091
|
-
this.
|
|
1083
|
+
this.titleControl.closeEditors(editorsToClose);
|
|
1092
1084
|
}
|
|
1093
1085
|
}
|
|
1094
1086
|
async replaceEditors(editors) {
|
|
@@ -1145,13 +1137,13 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
1145
1137
|
}
|
|
1146
1138
|
}
|
|
1147
1139
|
get isLocked() {
|
|
1148
|
-
if (this.
|
|
1140
|
+
if (this.groupsView.groups.length === 1) {
|
|
1149
1141
|
return false;
|
|
1150
1142
|
}
|
|
1151
1143
|
return this.model.isLocked;
|
|
1152
1144
|
}
|
|
1153
1145
|
lock(locked) {
|
|
1154
|
-
if (this.
|
|
1146
|
+
if (this.groupsView.groups.length === 1) {
|
|
1155
1147
|
locked = false;
|
|
1156
1148
|
}
|
|
1157
1149
|
this.model.lock(locked);
|
|
@@ -1173,7 +1165,7 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
1173
1165
|
this.titleContainer.classList.remove('title-border-bottom');
|
|
1174
1166
|
this.titleContainer.style.removeProperty('--title-border-bottom-color');
|
|
1175
1167
|
}
|
|
1176
|
-
const { showTabs } = this.
|
|
1168
|
+
const { showTabs } = this.groupsView.partOptions;
|
|
1177
1169
|
this.titleContainer.style.backgroundColor = this.getColor(showTabs ? EDITOR_GROUP_HEADER_TABS_BACKGROUND : EDITOR_GROUP_HEADER_NO_TABS_BACKGROUND) || '';
|
|
1178
1170
|
this.editorContainer.style.backgroundColor = this.getColor(editorBackground) || '';
|
|
1179
1171
|
}
|
|
@@ -1190,13 +1182,13 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
1190
1182
|
layout(width, height, top, left) {
|
|
1191
1183
|
this.lastLayout = { width, height, top, left };
|
|
1192
1184
|
this.element.classList.toggle('max-height-478px', height <= 478);
|
|
1193
|
-
const
|
|
1185
|
+
const titleControlSize = this.titleControl.layout({
|
|
1194
1186
|
container: ( new Dimension(width, height)),
|
|
1195
1187
|
available: ( new Dimension(width, height - this.editorPane.minimumHeight))
|
|
1196
1188
|
});
|
|
1197
|
-
const editorHeight = Math.max(0, height -
|
|
1189
|
+
const editorHeight = Math.max(0, height - titleControlSize.height);
|
|
1198
1190
|
this.editorContainer.style.height = `${editorHeight}px`;
|
|
1199
|
-
this.editorPane.layout({ width, height: editorHeight, top: top +
|
|
1191
|
+
this.editorPane.layout({ width, height: editorHeight, top: top + titleControlSize.height, left });
|
|
1200
1192
|
}
|
|
1201
1193
|
relayout() {
|
|
1202
1194
|
if (this.lastLayout) {
|
|
@@ -1213,7 +1205,6 @@ let EditorGroupView = EditorGroupView_1 = class EditorGroupView extends Themable
|
|
|
1213
1205
|
dispose() {
|
|
1214
1206
|
this._disposed = true;
|
|
1215
1207
|
this._onWillDispose.fire();
|
|
1216
|
-
this.titleAreaControl.dispose();
|
|
1217
1208
|
super.dispose();
|
|
1218
1209
|
}
|
|
1219
1210
|
};
|