This commit is contained in:
Henning Dieterichs
2024-07-22 15:14:43 +02:00
committed by Henning Dieterichs
parent e3b021a4c5
commit 84f63bf4e5
3 changed files with 10 additions and 1 deletions
@@ -101,6 +101,8 @@ export class DiffEditorOptions {
}))
.flatten()
.map(this, v => !!v);
public readonly inlineViewHideOriginalLineNumbers = this.compactMode;
}
function isSimpleDiff(diff: DiffState, supportsTrueDiffRendering: boolean): boolean {
@@ -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;
@@ -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 }));
}