mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
Clears input properly
This commit is contained in:
parent
666f8ddefc
commit
d2204f853f
2 changed files with 8 additions and 1 deletions
|
@ -11,12 +11,14 @@ import { IMultiDocumentDiffEditorModel } from 'vs/editor/browser/widget/multiDif
|
|||
import { MultiDiffEditorWidgetImpl } from 'vs/editor/browser/widget/multiDiffEditorWidget/multiDiffEditorWidgetImpl';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import './colors';
|
||||
import { DiffEditorItemTemplate } from 'vs/editor/browser/widget/multiDiffEditorWidget/diffEditorItemTemplate';
|
||||
|
||||
export class MultiDiffEditorWidget extends Disposable {
|
||||
private readonly _dimension = observableValue<Dimension | undefined>(this, undefined);
|
||||
private readonly _model = observableValue<IMultiDocumentDiffEditorModel | undefined>(this, undefined);
|
||||
|
||||
private readonly widgetImpl = derivedWithStore(this, (reader, store) => {
|
||||
readHotReloadableExport(DiffEditorItemTemplate, reader);
|
||||
return store.add(this._instantiationService.createInstance((
|
||||
readHotReloadableExport(MultiDiffEditorWidgetImpl, reader)),
|
||||
this._element,
|
||||
|
@ -34,7 +36,7 @@ export class MultiDiffEditorWidget extends Disposable {
|
|||
this._register(recomputeInitiallyAndOnChange(this.widgetImpl));
|
||||
}
|
||||
|
||||
public setModel(model: IMultiDocumentDiffEditorModel): void {
|
||||
public setModel(model: IMultiDocumentDiffEditorModel | undefined): void {
|
||||
this._model.set(model, undefined);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,6 +40,11 @@ export class MultiDiffEditor extends EditorPane {
|
|||
this._multiDiffEditorWidget?.setModel(vm);
|
||||
}
|
||||
|
||||
override async clearInput(): Promise<void> {
|
||||
await super.clearInput();
|
||||
this._multiDiffEditorWidget?.setModel(undefined);
|
||||
}
|
||||
|
||||
layout(dimension: DOM.Dimension): void {
|
||||
this._multiDiffEditorWidget?.layout(dimension);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue