mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-12 09:50:11 -05:00
Locked groups: inactive tab not revealed in locked group (fix #131520)
This commit is contained in:
@@ -163,10 +163,10 @@ function isGroupLockedForEditor(group: IEditorGroup, editor: IEditorInput | IUnt
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isActive(group, editor)) {
|
||||
// special case: the active editor of the locked group
|
||||
// matches the provided one, so in that case we do not
|
||||
// want to open the editor in any different group.
|
||||
if (isOpened(group, editor)) {
|
||||
// special case: the locked group contains
|
||||
// the provided editor. in that case we do not want
|
||||
// to open the editor in any different group.
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ suite('EditorService', () => {
|
||||
let input4: IResourceEditorInput = { resource: URI.parse('file://resource4-basics.editor-service-locked-group-tests'), options: { pinned: true } };
|
||||
let input5: IResourceEditorInput = { resource: URI.parse('file://resource5-basics.editor-service-locked-group-tests'), options: { pinned: true } };
|
||||
let input6: IResourceEditorInput = { resource: URI.parse('file://resource6-basics.editor-service-locked-group-tests'), options: { pinned: true } };
|
||||
let input7: IResourceEditorInput = { resource: URI.parse('file://resource7-basics.editor-service-locked-group-tests'), options: { pinned: true } };
|
||||
|
||||
let editor1 = await service.openEditor(input1, { pinned: true });
|
||||
let editor2 = await service.openEditor(input2, { pinned: true }, SIDE_GROUP);
|
||||
@@ -301,6 +302,14 @@ suite('EditorService', () => {
|
||||
assert.strictEqual(part.count, 4);
|
||||
assert.strictEqual(part.activeGroup, group3);
|
||||
assert.strictEqual(group3.activeEditor?.resource?.toString(), input6.resource.toString());
|
||||
|
||||
// Will reveal an opened editor in the active locked group
|
||||
await service.openEditor(input7, { pinned: true }, group3);
|
||||
await service.openEditor(input6, { pinned: true });
|
||||
|
||||
assert.strictEqual(part.count, 4);
|
||||
assert.strictEqual(part.activeGroup, group3);
|
||||
assert.strictEqual(group3.activeEditor?.resource?.toString(), input6.resource.toString());
|
||||
});
|
||||
|
||||
test('locked groups - workbench.editor.revealIfOpen', async () => {
|
||||
|
||||
Reference in New Issue
Block a user