Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Jul 24, 2024
1 parent 9219bf5 commit 38a7fcd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vs/editor/browser/widget/diffEditor/diffEditorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ export class DiffEditorOptions {
public readonly showEmptyDecorations = derived(this, reader => this._options.read(reader).experimental.showEmptyDecorations!);
public readonly onlyShowAccessibleDiffViewer = derived(this, reader => this._options.read(reader).onlyShowAccessibleDiffViewer);
public readonly compactMode = derived(this, reader => this._options.read(reader).compactMode);
private readonly trueInlineDiffRenderingEnabled: IObservable<boolean> = derived(this, reader =>
this._options.read(reader).experimental.useTrueInlineView!
);

public readonly useTrueInlineDiffRendering: IObservable<boolean> = derived(this, reader =>
!this.renderSideBySide.read(reader) && this._options.read(reader).experimental.useTrueInlineView!
!this.renderSideBySide.read(reader) && this.trueInlineDiffRenderingEnabled.read(reader)
);

public readonly hideUnchangedRegions = derived(this, reader => this._options.read(reader).hideUnchangedRegions.enabled!);
Expand All @@ -99,7 +103,7 @@ export class DiffEditorOptions {
private readonly shouldRenderInlineViewInSmartMode = this._model
.map(this, model => derivedConstOnceDefined(this, reader => {
const diffs = model?.diff.read(reader);
return diffs ? isSimpleDiff(diffs, this.useTrueInlineDiffRendering.read(reader)) : undefined;
return diffs ? isSimpleDiff(diffs, this.trueInlineDiffRenderingEnabled.read(reader)) : undefined;
}))
.flatten()
.map(this, v => !!v);
Expand Down

0 comments on commit 38a7fcd

Please sign in to comment.