提交 e71f31ab 编写于 作者: B Benjamin Pasero

editors - copied group is missing to register editor listeners

上级 313f4bfe
......@@ -724,12 +724,19 @@ export class EditorGroup extends Disposable {
clone(): EditorGroup {
const group = this.instantiationService.createInstance(EditorGroup, undefined);
// Copy over group properties
group.editors = this.editors.slice(0);
group.mru = this.mru.slice(0);
group.preview = this.preview;
group.active = this.active;
group.sticky = this.sticky;
// Ensure to register listeners for each editor
for (const editor of group.editors) {
group.registerEditorListeners(editor);
}
return group;
}
......
......@@ -239,7 +239,7 @@ suite('Workbench editor groups', () => {
test('Clone Group', function () {
const group = createGroup();
const input1 = input();
const input1 = input() as TestEditorInput;
const input2 = input();
const input3 = input();
......@@ -256,6 +256,11 @@ suite('Workbench editor groups', () => {
assert.notEqual(group.id, clone.id);
assert.equal(clone.count, 3);
let didEditorLabelChange = false;
const toDispose = clone.onDidEditorLabelChange(() => didEditorLabelChange = true);
input1.setLabel();
assert.ok(didEditorLabelChange);
assert.equal(clone.isPinned(input1), true);
assert.equal(clone.isActive(input1), false);
assert.equal(clone.isSticky(input1), false);
......@@ -267,6 +272,8 @@ suite('Workbench editor groups', () => {
assert.equal(clone.isPinned(input3), false);
assert.equal(clone.isActive(input3), true);
assert.equal(clone.isSticky(input3), false);
toDispose.dispose();
});
test('contains()', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册