mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
Fix #120343
This commit is contained in:
@@ -1025,24 +1025,21 @@ export class DefaultPreferencesEditor extends BaseTextEditor {
|
||||
return options;
|
||||
}
|
||||
|
||||
setInput(input: DefaultPreferencesEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
||||
return super.setInput(input, options, context, token)
|
||||
.then(() => this.input!.resolve()
|
||||
.then<any>(editorModel => {
|
||||
if (token.isCancellationRequested) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return editorModel!.resolve();
|
||||
})
|
||||
.then(editorModel => {
|
||||
if (token.isCancellationRequested) {
|
||||
return;
|
||||
}
|
||||
|
||||
const editor = assertIsDefined(this.getControl());
|
||||
editor.setModel((<ResourceEditorModel>editorModel).textEditorModel);
|
||||
}));
|
||||
async setInput(input: DefaultPreferencesEditorInput, options: EditorOptions | undefined, context: IEditorOpenContext, token: CancellationToken): Promise<void> {
|
||||
await super.setInput(input, options, context, token);
|
||||
const editorModel = await this.input!.resolve();
|
||||
if (!editorModel) {
|
||||
return;
|
||||
}
|
||||
if (token.isCancellationRequested) {
|
||||
return;
|
||||
}
|
||||
await editorModel.resolve();
|
||||
if (token.isCancellationRequested) {
|
||||
return;
|
||||
}
|
||||
const editor = assertIsDefined(this.getControl());
|
||||
editor.setModel((<ResourceEditorModel>editorModel).textEditorModel);
|
||||
}
|
||||
|
||||
clearInput(): void {
|
||||
|
||||
Reference in New Issue
Block a user