Skip to content

Commit a323ac9

Browse files
committed
fix: modified editor width(diffEditor v2)
1 parent 2a19176 commit a323ac9

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

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

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -235,19 +235,16 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
235235
const sashLeft = this._sash.read(reader)?.sashLeft.read(reader);
236236

237237
const originalWidth = sashLeft ?? Math.max(5, this._editors.original.getLayoutInfo().decorationsLeft);
238+
const modifiedWidth = width - originalWidth - (this._options.renderOverviewRuler.read(reader) ? OverviewRulerPart.ENTIRE_DIFF_OVERVIEW_WIDTH : 0);
238239

239240
this.elements.original.style.width = originalWidth + 'px';
240241
this.elements.original.style.left = '0px';
241242

242-
this.elements.modified.style.width = (width - originalWidth) + 'px';
243+
this.elements.modified.style.width = modifiedWidth + 'px';
243244
this.elements.modified.style.left = originalWidth + 'px';
244245

245-
this._editors.original.layout({ width: originalWidth, height: height });
246-
this._editors.modified.layout({
247-
width: width - originalWidth -
248-
(this._options.renderOverviewRuler.read(reader) ? OverviewRulerPart.ENTIRE_DIFF_OVERVIEW_WIDTH : 0),
249-
height
250-
});
246+
this._editors.original.layout({ width: originalWidth, height });
247+
this._editors.modified.layout({ width: modifiedWidth, height });
251248
this._reviewPane.layout(0, width, height);
252249

253250
return {

0 commit comments

Comments
 (0)