Fix #118010

上级 57a760e7
......@@ -38,12 +38,13 @@ import { SelectActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewIte
import { Dimension } from 'vs/base/browser/dom';
import { IActionViewItem } from 'vs/base/browser/ui/actionbar/actionbar';
import { ITextEditorOptions } from 'vs/platform/editor/common/editor';
import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';
export class OutputViewPane extends ViewPane {
private readonly editor: OutputEditor;
private channelId: string | undefined;
private editorPromise: Promise<OutputEditor> | null = null;
private editorPromise: CancelablePromise<OutputEditor> | null = null;
private readonly scrollLockContextKey: IContextKey<boolean>;
get scrollLock(): boolean { return !!this.scrollLockContextKey.get(); }
......@@ -147,8 +148,16 @@ export class OutputViewPane extends ViewPane {
this.channelId = channel.id;
const descriptor = this.outputService.getChannelDescriptor(channel.id);
CONTEXT_ACTIVE_LOG_OUTPUT.bindTo(this.contextKeyService).set(!!descriptor?.file && descriptor?.log);
this.editorPromise = this.editor.setInput(this.createInput(channel), { preserveFocus: true }, Object.create(null), CancellationToken.None)
.then(() => this.editor);
const input = this.createInput(channel);
if (!input.matches(this.editor.input)) {
if (this.editorPromise) {
this.editorPromise.cancel();
}
this.editorPromise = createCancelablePromise(token => this.editor.setInput(this.createInput(channel), { preserveFocus: true }, Object.create(null), token)
.then(() => this.editor));
}
}
private clearInput(): void {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册