@opensumi/ide-editor 3.3.1-next-1725517520.0 → 3.3.1-next-1725521092.0
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/lib/browser/editor-collection.service.d.ts +1 -1
- package/lib/browser/editor-collection.service.d.ts.map +1 -1
- package/lib/browser/editor-collection.service.js +2 -2
- package/lib/browser/editor-collection.service.js.map +1 -1
- package/lib/browser/editor.contribution.d.ts.map +1 -1
- package/lib/browser/editor.contribution.js.map +1 -1
- package/lib/browser/editor.module.less +0 -1
- package/lib/browser/editor.view.d.ts +2 -4
- package/lib/browser/editor.view.d.ts.map +1 -1
- package/lib/browser/editor.view.js +19 -8
- package/lib/browser/editor.view.js.map +1 -1
- package/lib/browser/workbench-editor.service.d.ts +3 -6
- package/lib/browser/workbench-editor.service.d.ts.map +1 -1
- package/lib/browser/workbench-editor.service.js +97 -109
- package/lib/browser/workbench-editor.service.js.map +1 -1
- package/lib/common/editor.d.ts +1 -1
- package/lib/common/editor.d.ts.map +1 -1
- package/package.json +14 -14
- package/src/browser/editor-collection.service.ts +2 -2
- package/src/browser/editor.contribution.ts +4 -1
- package/src/browser/editor.module.less +0 -1
- package/src/browser/editor.view.tsx +192 -182
- package/src/browser/workbench-editor.service.ts +99 -105
- package/src/common/editor.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workbench-editor.service.d.ts","sourceRoot":"","sources":["../../src/browser/workbench-editor.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workbench-editor.service.d.ts","sourceRoot":"","sources":["../../src/browser/workbench-editor.service.ts"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EAGT,kBAAkB,EAClB,cAAc,EACd,wBAAwB,EAExB,iBAAiB,EAOlB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,kBAAkB,EAAwB,MAAM,2DAA2D,CAAC;AACrH,OAAO,EAIL,QAAQ,EAER,OAAO,EACP,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,CAAC,EAAE,WAAW,EAAE,cAAc,CAAC,EAAE,SAAS;IA0DhH,SAAS;IAIT,KAAK;IAWL,OAAO;IAaP,QAAQ,IAAI,iBAAiB;IAU7B,gBAAgB;IAIhB,gBAAgB;IAIhB,eAAe;IAIT,YAAY,CAAC,KAAK,EAAE,iBAAiB;IAiCrC,OAAO,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,UAAU;IAUtD,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAE,UAA8B;IAcxE,cAAc,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IAazE,WAAW,CAAC,MAAM,GAAE,UAA8B;IAaxD,QAAQ,IAAI,OAAO;IAYnB;;OAEG;IACH,cAAc,CAAC,WAAW,GAAE,GAAG,CAAC,MAAM,CAAqB,GAAG,MAAM;IAiBpE,aAAa;IAOb,aAAa;IAOb;;OAEG;IACH,MAAM;;;CAKP;AAyCD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAChC,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EditorGroup = exports.WorkbenchEditorServiceImpl = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const mobx_1 = require("mobx");
|
|
6
5
|
const di_1 = require("@opensumi/di");
|
|
7
6
|
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
8
7
|
const resource_1 = require("@opensumi/ide-core-browser/lib/contextkey/resource");
|
|
@@ -121,44 +120,37 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
121
120
|
createEditorGroup() {
|
|
122
121
|
const editorGroup = this.injector.get(EditorGroup, [this.generateRandomEditorGroupName(), this.editorGroupIdGen++]);
|
|
123
122
|
this.editorGroups.push(editorGroup);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
if (
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
123
|
+
editorGroup.addDispose([
|
|
124
|
+
editorGroup.onDidEditorGroupBodyChanged(() => {
|
|
125
|
+
if (editorGroup === this.currentEditorGroup) {
|
|
126
|
+
if (!editorGroup.currentOpenType && editorGroup.currentResource) {
|
|
127
|
+
// 暂时状态,不发事件
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this._onActiveResourceChange.fire(editorGroup.currentResource);
|
|
131
|
+
}
|
|
131
132
|
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
}),
|
|
134
|
+
editorGroup.onDidEditorFocusChange(() => {
|
|
135
|
+
var _a;
|
|
136
|
+
if (editorGroup === this.currentEditorGroup) {
|
|
137
|
+
if (!editorGroup.currentOpenType && editorGroup.currentResource) {
|
|
138
|
+
// 暂时状态,不发事件
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
this._onActiveEditorUriChange.fire((_a = editorGroup.currentOrPreviousFocusedEditor) === null || _a === void 0 ? void 0 : _a.currentUri);
|
|
142
|
+
}
|
|
138
143
|
}
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
}),
|
|
145
|
+
editorGroup.onDidEditorGroupTabChanged(() => {
|
|
146
|
+
this.saveOpenedResourceState();
|
|
147
|
+
}),
|
|
148
|
+
editorGroup.onCurrentEditorCursorChange((e) => {
|
|
149
|
+
if (this._currentEditorGroup === editorGroup) {
|
|
150
|
+
this._onCursorChange.fire(e);
|
|
141
151
|
}
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
editorGroup.addDispose({
|
|
145
|
-
dispose: () => {
|
|
146
|
-
currentWatchDisposer.dispose();
|
|
147
|
-
},
|
|
148
|
-
});
|
|
149
|
-
const groupChangeDisposer = editorGroup.onDidEditorGroupTabChanged(() => {
|
|
150
|
-
this.saveOpenedResourceState();
|
|
151
|
-
});
|
|
152
|
-
editorGroup.addDispose({
|
|
153
|
-
dispose: () => {
|
|
154
|
-
groupChangeDisposer.dispose();
|
|
155
|
-
},
|
|
156
|
-
});
|
|
157
|
-
editorGroup.onCurrentEditorCursorChange((e) => {
|
|
158
|
-
if (this._currentEditorGroup === editorGroup) {
|
|
159
|
-
this._onCursorChange.fire(e);
|
|
160
|
-
}
|
|
161
|
-
});
|
|
152
|
+
}),
|
|
153
|
+
]);
|
|
162
154
|
return editorGroup;
|
|
163
155
|
}
|
|
164
156
|
/**
|
|
@@ -303,6 +295,7 @@ let WorkbenchEditorServiceImpl = class WorkbenchEditorServiceImpl extends ide_co
|
|
|
303
295
|
}
|
|
304
296
|
}
|
|
305
297
|
onDomCreated(domNode) {
|
|
298
|
+
this._domNode = domNode;
|
|
306
299
|
if (this.editorContextKeyService) {
|
|
307
300
|
this.editorContextKeyService.attachToDomNode(domNode);
|
|
308
301
|
}
|
|
@@ -496,22 +489,22 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
496
489
|
/**
|
|
497
490
|
* 当编辑器的tab部分发生变更
|
|
498
491
|
*/
|
|
499
|
-
this._onDidEditorGroupTabChanged = new ide_core_common_1.Emitter();
|
|
492
|
+
this._onDidEditorGroupTabChanged = this.registerDispose(new ide_core_common_1.Emitter());
|
|
500
493
|
this.onDidEditorGroupTabChanged = this._onDidEditorGroupTabChanged.event;
|
|
501
494
|
/**
|
|
502
495
|
* 当编辑器的tab部分发生变更
|
|
503
496
|
*/
|
|
504
|
-
this._onDidEditorGroupTabOperation = new ide_core_common_1.Emitter();
|
|
497
|
+
this._onDidEditorGroupTabOperation = this.registerDispose(new ide_core_common_1.Emitter());
|
|
505
498
|
this.onDidEditorGroupTabOperation = this._onDidEditorGroupTabOperation.event;
|
|
506
499
|
/**
|
|
507
500
|
* 当编辑器的主体部分发生变更
|
|
508
501
|
*/
|
|
509
|
-
this._onDidEditorGroupBodyChanged = new ide_core_common_1.Emitter();
|
|
502
|
+
this._onDidEditorGroupBodyChanged = this.registerDispose(new ide_core_common_1.Emitter());
|
|
510
503
|
this.onDidEditorGroupBodyChanged = this._onDidEditorGroupBodyChanged.event;
|
|
511
504
|
/**
|
|
512
505
|
* 当编辑器有内容处于加载状态
|
|
513
506
|
*/
|
|
514
|
-
this._onDidEditorGroupContentLoading = new ide_core_common_1.Emitter();
|
|
507
|
+
this._onDidEditorGroupContentLoading = this.registerDispose(new ide_core_common_1.Emitter());
|
|
515
508
|
this.onDidEditorGroupContentLoading = this._onDidEditorGroupContentLoading.event;
|
|
516
509
|
/**
|
|
517
510
|
* 每个group只能有一个preview
|
|
@@ -531,11 +524,10 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
531
524
|
this.activeComponents = new Map();
|
|
532
525
|
this.activateComponentsProps = new Map();
|
|
533
526
|
this.holdDocumentModelRefs = new Map();
|
|
534
|
-
this.toDispose = [];
|
|
535
527
|
this._prevDomHeight = 0;
|
|
536
528
|
this._prevDomWidth = 0;
|
|
537
529
|
// 当前为EditorComponent,且monaco光标变化时触发
|
|
538
|
-
this._onCurrentEditorCursorChange = new ide_core_common_1.Emitter();
|
|
530
|
+
this._onCurrentEditorCursorChange = this.registerDispose(new ide_core_common_1.Emitter());
|
|
539
531
|
this.onCurrentEditorCursorChange = this._onCurrentEditorCursorChange.event;
|
|
540
532
|
this.resourceOpenHistory = [];
|
|
541
533
|
this._domNode = null;
|
|
@@ -549,26 +541,24 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
549
541
|
this.mergeEditorReady = new ide_core_common_1.ReadyEvent();
|
|
550
542
|
this.mergeEditorDomReady = new ide_core_common_1.ReadyEvent();
|
|
551
543
|
this._restoringState = false;
|
|
552
|
-
this.eventBus.onDirective(ide_core_browser_1.ResizeEvent.createDirective((0, ide_core_browser_1.getSlotLocation)('@opensumi/ide-editor', this.config.layoutConfig)), () => {
|
|
553
|
-
this.
|
|
554
|
-
});
|
|
555
|
-
this.eventBus.on(types_2.GridResizeEvent, (e) => {
|
|
544
|
+
this.addDispose(this.eventBus.onDirective(ide_core_browser_1.ResizeEvent.createDirective((0, ide_core_browser_1.getSlotLocation)('@opensumi/ide-editor', this.config.layoutConfig)), () => {
|
|
545
|
+
this.layoutEditors();
|
|
546
|
+
}));
|
|
547
|
+
this.addDispose(this.eventBus.on(types_2.GridResizeEvent, (e) => {
|
|
556
548
|
if (e.payload.gridId === this.grid.uid) {
|
|
557
|
-
this.
|
|
549
|
+
this.layoutEditors();
|
|
558
550
|
}
|
|
559
|
-
});
|
|
560
|
-
this.eventBus.on(types_2.EditorComponentDisposeEvent, (e) => {
|
|
551
|
+
}));
|
|
552
|
+
this.addDispose(this.eventBus.on(types_2.EditorComponentDisposeEvent, (e) => {
|
|
561
553
|
this.activeComponents.delete(e.payload);
|
|
562
554
|
this.activateComponentsProps.delete(e.payload);
|
|
563
|
-
});
|
|
555
|
+
}));
|
|
564
556
|
this.listenToExplorerAutoRevealConfig();
|
|
565
557
|
}
|
|
566
558
|
listenToExplorerAutoRevealConfig() {
|
|
567
559
|
this.explorerAutoRevealConfig = !!this.preferenceService.get('explorer.autoReveal');
|
|
568
|
-
this.disposables.push(this.preferenceService.
|
|
569
|
-
|
|
570
|
-
this.explorerAutoRevealConfig = change.newValue;
|
|
571
|
-
}
|
|
560
|
+
this.disposables.push(this.preferenceService.onSpecificPreferenceChange('explorer.autoReveal', (change) => {
|
|
561
|
+
this.explorerAutoRevealConfig = change.newValue;
|
|
572
562
|
}));
|
|
573
563
|
}
|
|
574
564
|
attachDiffEditorDom(domNode) {
|
|
@@ -595,42 +585,26 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
595
585
|
layoutEditors() {
|
|
596
586
|
ide_core_browser_1.fastdom.measure(() => {
|
|
597
587
|
if (this._domNode) {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
this.
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
this._prevDomHeight = currentHeight;
|
|
588
|
+
this._prevDomWidth = this._domNode.offsetWidth;
|
|
589
|
+
this._prevDomHeight = this._domNode.offsetHeight;
|
|
590
|
+
this.doLayoutEditors({
|
|
591
|
+
width: this._prevDomWidth,
|
|
592
|
+
height: this._prevDomHeight,
|
|
593
|
+
}, true);
|
|
605
594
|
}
|
|
606
595
|
});
|
|
607
596
|
}
|
|
608
|
-
|
|
609
|
-
if (
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
case types_2.EditorOpenType.code:
|
|
614
|
-
if (this.codeEditor) {
|
|
615
|
-
this.codeEditor.layout();
|
|
616
|
-
}
|
|
617
|
-
break;
|
|
618
|
-
case types_2.EditorOpenType.diff:
|
|
619
|
-
if (this.diffEditor) {
|
|
620
|
-
this.diffEditor.layout();
|
|
621
|
-
}
|
|
622
|
-
break;
|
|
623
|
-
default:
|
|
624
|
-
break;
|
|
597
|
+
doLayoutEditors(e, postponeRendering) {
|
|
598
|
+
if (this.codeEditor) {
|
|
599
|
+
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.code) {
|
|
600
|
+
this.codeEditor.layout(e, postponeRendering);
|
|
601
|
+
}
|
|
625
602
|
}
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
603
|
+
if (this.diffEditor) {
|
|
604
|
+
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.diff) {
|
|
605
|
+
this.diffEditor.layout(e, postponeRendering);
|
|
606
|
+
}
|
|
630
607
|
}
|
|
631
|
-
this._measure = ide_core_browser_1.fastdom.mutate(() => {
|
|
632
|
-
this._layoutEditorWorker();
|
|
633
|
-
});
|
|
634
608
|
}
|
|
635
609
|
setContextKeys() {
|
|
636
610
|
var _a;
|
|
@@ -643,8 +617,24 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
643
617
|
}
|
|
644
618
|
return result;
|
|
645
619
|
};
|
|
646
|
-
this._resourceContext = new resource_1.ResourceContextKey(this.contextKeyService, (uri) =>
|
|
647
|
-
|
|
620
|
+
this._resourceContext = new resource_1.ResourceContextKey(this.contextKeyService, (uri) => {
|
|
621
|
+
const res = getLanguageFromModel(uri);
|
|
622
|
+
if (res) {
|
|
623
|
+
return res;
|
|
624
|
+
}
|
|
625
|
+
else {
|
|
626
|
+
return getLanguageFromModel(uri);
|
|
627
|
+
}
|
|
628
|
+
});
|
|
629
|
+
this._diffResourceContextKey = new resource_1.ResourceContextKey(this.contextKeyService, (uri) => {
|
|
630
|
+
const res = getLanguageFromModel(uri);
|
|
631
|
+
if (res) {
|
|
632
|
+
return res;
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
return getLanguageFromModel(uri);
|
|
636
|
+
}
|
|
637
|
+
}, 'diffResource');
|
|
648
638
|
this._editorLangIDContextKey = this.contextKeyService.createKey('editorLangId', '');
|
|
649
639
|
this._isInDiffEditorContextKey = this.contextKeyService.createKey('isInDiffEditor', false);
|
|
650
640
|
this._isInDiffRightEditorContextKey = this.contextKeyService.createKey('isInDiffRightEditor', false);
|
|
@@ -728,16 +718,13 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
728
718
|
this.notifyTabChanged();
|
|
729
719
|
}
|
|
730
720
|
}
|
|
731
|
-
resetOpenType() {
|
|
732
|
-
this._currentOpenType = null;
|
|
733
|
-
}
|
|
734
721
|
oResourceOpenTypeChangedEvent(e) {
|
|
735
722
|
const uri = e.payload;
|
|
736
723
|
if (this.cachedResourcesOpenTypes.has(uri.toString())) {
|
|
737
724
|
this.cachedResourcesOpenTypes.delete(uri.toString());
|
|
738
725
|
}
|
|
739
726
|
if (this.currentResource && this.currentResource.uri.isEqual(uri)) {
|
|
740
|
-
this.
|
|
727
|
+
this._currentOpenType = null;
|
|
741
728
|
this.notifyBodyChanged();
|
|
742
729
|
this.displayResourceComponent(this.currentResource, {});
|
|
743
730
|
}
|
|
@@ -837,15 +824,17 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
837
824
|
[ide_core_browser_1.ServiceNames.CONTEXT_KEY_SERVICE]: this.contextKeyService.contextKeyService,
|
|
838
825
|
});
|
|
839
826
|
setTimeout(() => {
|
|
840
|
-
|
|
827
|
+
ide_core_browser_1.fastdom.mutate(() => {
|
|
828
|
+
this.codeEditor.layout();
|
|
829
|
+
});
|
|
841
830
|
});
|
|
842
831
|
this.addDispose(this.codeEditor.onRefOpen(() => {
|
|
843
|
-
this.
|
|
832
|
+
this.codeEditor.layout();
|
|
844
833
|
}));
|
|
845
|
-
this.
|
|
834
|
+
this.addDispose(this.codeEditor.onCursorPositionChanged((e) => {
|
|
846
835
|
this._onCurrentEditorCursorChange.fire(e);
|
|
847
836
|
}));
|
|
848
|
-
this.
|
|
837
|
+
this.addDispose(this.codeEditor.onSelectionsChanged((e) => {
|
|
849
838
|
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.code) {
|
|
850
839
|
this.eventBus.fire(new types_2.EditorSelectionChangeEvent({
|
|
851
840
|
group: this,
|
|
@@ -856,7 +845,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
856
845
|
}));
|
|
857
846
|
}
|
|
858
847
|
}));
|
|
859
|
-
this.
|
|
848
|
+
this.addDispose(this.codeEditor.onVisibleRangesChanged((e) => {
|
|
860
849
|
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.code) {
|
|
861
850
|
this.eventBus.fire(new types_2.EditorVisibleChangeEvent({
|
|
862
851
|
group: this,
|
|
@@ -866,7 +855,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
866
855
|
}));
|
|
867
856
|
}
|
|
868
857
|
}));
|
|
869
|
-
this.
|
|
858
|
+
this.addDispose(this.codeEditor.onConfigurationChanged(() => {
|
|
870
859
|
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.code) {
|
|
871
860
|
this.eventBus.fire(new types_2.EditorConfigurationChangedEvent({
|
|
872
861
|
group: this,
|
|
@@ -893,10 +882,14 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
893
882
|
[ide_core_browser_1.ServiceNames.CONTEXT_KEY_SERVICE]: this.contextKeyService.contextKeyService,
|
|
894
883
|
});
|
|
895
884
|
setTimeout(() => {
|
|
896
|
-
|
|
885
|
+
ide_core_browser_1.fastdom.mutate(() => {
|
|
886
|
+
this.diffEditor.layout();
|
|
887
|
+
});
|
|
897
888
|
});
|
|
898
889
|
this.diffEditor.onRefOpen(() => {
|
|
899
|
-
|
|
890
|
+
ide_core_browser_1.fastdom.mutate(() => {
|
|
891
|
+
this.diffEditor.layout();
|
|
892
|
+
});
|
|
900
893
|
});
|
|
901
894
|
this.addDiffEditorEventListeners(this.diffEditor.originalEditor, 'original');
|
|
902
895
|
this.addDiffEditorEventListeners(this.diffEditor.modifiedEditor, 'modified');
|
|
@@ -913,7 +906,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
913
906
|
this.diffEditorReady.ready();
|
|
914
907
|
}
|
|
915
908
|
addDiffEditorEventListeners(editor, side) {
|
|
916
|
-
this.
|
|
909
|
+
this.addDispose(editor.onSelectionsChanged((e) => {
|
|
917
910
|
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.diff) {
|
|
918
911
|
this.eventBus.fire(new types_2.EditorSelectionChangeEvent({
|
|
919
912
|
group: this,
|
|
@@ -925,7 +918,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
925
918
|
}));
|
|
926
919
|
}
|
|
927
920
|
}));
|
|
928
|
-
this.
|
|
921
|
+
this.addDispose(editor.onVisibleRangesChanged((e) => {
|
|
929
922
|
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.diff) {
|
|
930
923
|
this.eventBus.fire(new types_2.EditorVisibleChangeEvent({
|
|
931
924
|
group: this,
|
|
@@ -935,7 +928,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
935
928
|
}));
|
|
936
929
|
}
|
|
937
930
|
}));
|
|
938
|
-
this.
|
|
931
|
+
this.addDispose(editor.onConfigurationChanged(() => {
|
|
939
932
|
if (this.currentOpenType && this.currentOpenType.type === types_2.EditorOpenType.diff) {
|
|
940
933
|
this.eventBus.fire(new types_2.EditorConfigurationChangedEvent({
|
|
941
934
|
group: this,
|
|
@@ -1442,7 +1435,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1442
1435
|
this.resolveTabChanged(_resource, this.currentResource);
|
|
1443
1436
|
this._currentOpenType = activeOpenType;
|
|
1444
1437
|
this.notifyBodyChanged();
|
|
1445
|
-
this.
|
|
1438
|
+
this.layoutEditors();
|
|
1446
1439
|
this.cachedResourcesActiveOpenTypes.set(resource.uri.toString(), activeOpenType);
|
|
1447
1440
|
}
|
|
1448
1441
|
}
|
|
@@ -1567,7 +1560,7 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1567
1560
|
const oldOpenType = this._currentOpenType;
|
|
1568
1561
|
const oldResource = this._currentResource;
|
|
1569
1562
|
this._currentResource = null;
|
|
1570
|
-
this.
|
|
1563
|
+
this._currentOpenType = null;
|
|
1571
1564
|
this.notifyTabChanged();
|
|
1572
1565
|
this.notifyBodyChanged();
|
|
1573
1566
|
this._currentOrPreviousFocusedEditor = null;
|
|
@@ -1799,7 +1792,6 @@ let EditorGroup = class EditorGroup extends ide_core_common_1.WithEventBus {
|
|
|
1799
1792
|
super.dispose();
|
|
1800
1793
|
this.codeEditor && this.codeEditor.dispose();
|
|
1801
1794
|
this.diffEditor && this.diffEditor.dispose();
|
|
1802
|
-
this.toDispose.forEach((disposable) => disposable.dispose());
|
|
1803
1795
|
this.eventBus.fire(new types_2.EditorGroupDisposeEvent({
|
|
1804
1796
|
group: this,
|
|
1805
1797
|
}));
|
|
@@ -2000,10 +1992,6 @@ tslib_1.__decorate([
|
|
|
2000
1992
|
(0, di_1.Autowired)(ide_core_common_1.ILogger),
|
|
2001
1993
|
tslib_1.__metadata("design:type", Object)
|
|
2002
1994
|
], EditorGroup.prototype, "logger", void 0);
|
|
2003
|
-
tslib_1.__decorate([
|
|
2004
|
-
mobx_1.observable.shallow,
|
|
2005
|
-
tslib_1.__metadata("design:type", Array)
|
|
2006
|
-
], EditorGroup.prototype, "availableOpenTypes", void 0);
|
|
2007
1995
|
tslib_1.__decorate([
|
|
2008
1996
|
(0, ide_core_common_1.OnEvent)(common_1.ResourceDecorationChangeEvent),
|
|
2009
1997
|
tslib_1.__metadata("design:type", Function),
|