Skip to content

Commit

Permalink
Fix #127314
Browse files Browse the repository at this point in the history
  • Loading branch information
lramos15 committed Jun 29, 2021
1 parent 37ebadd commit 59ce56f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,15 +328,15 @@ export class EditorOverrideService extends Disposable implements IEditorOverride
return;
}
const inputWithOptions = selectedEditor.createDiffEditorInput(editor, group);
return inputWithOptions;
return { editor: inputWithOptions.editor, options: inputWithOptions.options ?? options };
}

if (isUntitledResourceEditorInput(editor)) {
if (!selectedEditor.createUntitledEditorInput) {
return;
}
const inputWithOptions = selectedEditor.createUntitledEditorInput(editor, group);
return inputWithOptions;
return { editor: inputWithOptions.editor, options: inputWithOptions.options ?? options };
}

// Should no longer have an undefined resource so lets throw an error if that's somehow the case
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ suite('EditorService', () => {
assert.strictEqual(pane?.group, rootGroup);
assert.ok(pane.input instanceof TestFileEditorInput);
assert.strictEqual(pane.input.resource.scheme, 'untitled');
// assert.strictEqual(pane.group.isSticky(pane.input), true); TODO@bpasero https://github.com/microsoft/vscode/issues/127314
assert.strictEqual(pane.group.isSticky(pane.input), true);

assert.strictEqual(editorFactoryCalled, 0);
assert.strictEqual(untitledEditorFactoryCalled, 1);
Expand Down Expand Up @@ -865,8 +865,7 @@ suite('EditorService', () => {

assert.strictEqual(pane?.group, rootGroup);
assert.ok(pane.input instanceof TestFileEditorInput);
// assert.strictEqual(pane.group.isSticky(pane.input), true); TODO@bpasero https://github.com/microsoft/vscode/issues/127314

assert.strictEqual(pane.group.isSticky(pane.input), true);
assert.strictEqual(editorFactoryCalled, 0);
assert.strictEqual(untitledEditorFactoryCalled, 0);
assert.strictEqual(diffEditorFactoryCalled, 1);
Expand Down

0 comments on commit 59ce56f

Please sign in to comment.