Skip to content

Commit e7776fd

Browse files
authored
1 parent 4c1e4bb commit e7776fd

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/vs/editor/browser/widget/diffEditorWidget2/diffEditorWidget2.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,11 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
315315
override getModel(): IDiffEditorModel | null { return this._diffModel.get()?.model ?? null; }
316316

317317
override setModel(model: IDiffEditorModel | null | IDiffEditorViewModel): void {
318+
if (!model && this._diffModel.get()) {
319+
// Transitioning from a model to no-model
320+
this._reviewPane.hide();
321+
}
322+
318323
const vm = model ? ('model' in model) ? model : this.createViewModel(model) : undefined;
319324
this._editors.original.setModel(vm ? vm.model.original : null);
320325
this._editors.modified.setModel(vm ? vm.model.modified : null);

src/vs/editor/browser/widget/diffEditorWidget2/diffReview.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export class DiffReview2 extends Disposable {
277277
}
278278
}
279279

280-
private hide(): void {
280+
public hide(): void {
281281
this._isVisibleObs.set(false, undefined);
282282
this._diffEditor.focus();
283283
this.layout();

0 commit comments

Comments
 (0)