Skip to content

Commit 371a752

Browse files
committed
diff editor content height is the max of two editors.
1 parent cd55420 commit 371a752

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,18 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
517517
}
518518
}));
519519

520+
this._register(editor.onDidContentSizeChange(e => {
521+
const width = this.originalEditor.getContentWidth() + this.modifiedEditor.getContentWidth() + DiffEditorWidget.ONE_OVERVIEW_WIDTH;
522+
const height = Math.max(this.modifiedEditor.getContentHeight(), this.originalEditor.getContentHeight());
523+
524+
this._onDidContentSizeChange.fire({
525+
contentHeight: height,
526+
contentWidth: width,
527+
contentHeightChanged: e.contentHeightChanged,
528+
contentWidthChanged: e.contentWidthChanged
529+
});
530+
}));
531+
520532
return editor;
521533
}
522534

@@ -563,8 +575,8 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
563575
}));
564576

565577
this._register(editor.onDidContentSizeChange(e => {
566-
const width = this.originalEditor.getContentWidth() + this.modifiedEditor.getContentWidth();
567-
const height = this.modifiedEditor.getContentHeight();
578+
const width = this.originalEditor.getContentWidth() + this.modifiedEditor.getContentWidth() + DiffEditorWidget.ONE_OVERVIEW_WIDTH;
579+
const height = Math.max(this.modifiedEditor.getContentHeight(), this.originalEditor.getContentHeight());
568580

569581
this._onDidContentSizeChange.fire({
570582
contentHeight: height,

0 commit comments

Comments
 (0)