Skip to content

Commit

Permalink
Fixes #221245
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Jul 22, 2024
1 parent e3b021a commit 84f63bf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/vs/editor/browser/widget/diffEditor/diffEditorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ export class DiffEditorOptions {
}))
.flatten()
.map(this, v => !!v);

public readonly inlineViewHideOriginalLineNumbers = this.compactMode;
}

function isSimpleDiff(diff: DiffState, supportsTrueDiffRendering: boolean): boolean {
Expand Down
7 changes: 6 additions & 1 deletion src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,13 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {
} else {
gutterLeft = 0;

const shouldHideOriginalLineNumbers = this._options.inlineViewHideOriginalLineNumbers.read(reader);
originalLeft = gutterWidth;
originalWidth = Math.max(5, this._editors.original.getLayoutInfo().decorationsLeft);
if (shouldHideOriginalLineNumbers) {
originalWidth = 0;
} else {
originalWidth = Math.max(5, this._editors.original.getLayoutInfo().decorationsLeft);
}

modifiedLeft = gutterWidth + originalWidth;
modifiedWidth = fullWidth - modifiedLeft - overviewRulerPartWidth;
Expand Down
2 changes: 2 additions & 0 deletions src/vs/workbench/contrib/chat/browser/codeBlockPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,11 @@ export class CodeCompareBlockPart extends Disposable {
useTrueInlineView: true,
},
renderSideBySideInlineBreakpoint: 300,
renderOverviewRuler: false,
compactMode: true,
hideUnchangedRegions: { enabled: true, contextLineCount: 1 },
renderGutterMenu: false,
lineNumbersMinChars: 1,
...options
}, { originalEditor: widgetOptions, modifiedEditor: widgetOptions }));
}
Expand Down

0 comments on commit 84f63bf

Please sign in to comment.