Skip to content

Commit 8193f2f

Browse files
committed
Don't show revert arrows in inline mode.
1 parent 44bab69 commit 8193f2f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
8888
private _editorOptions: IEditorOptions;
8989
private readonly _sash: IObservable<DiffEditorSash | undefined>;
9090
private readonly _boundarySashes = observableValue<IBoundarySashes | undefined>('boundarySashes', undefined);
91-
private readonly _renderOverviewRuler: IObservable<boolean>;
91+
private readonly _renderOverviewRuler = derived('renderOverviewRuler', reader => this._options.read(reader).renderOverviewRuler);
92+
private readonly _renderSideBySide = derived('renderSideBySide', reader => this._options.read(reader).renderSideBySide);
9293

9394
private unchangedRangesFeature!: UnchangedRangesFeature;
9495

@@ -124,7 +125,6 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
124125
this._register(applyObservableDecorations(this._originalEditor, this._decorations.map(d => d?.originalDecorations || [])));
125126
this._register(applyObservableDecorations(this._modifiedEditor, this._decorations.map(d => d?.modifiedDecorations || [])));
126127

127-
this._renderOverviewRuler = this._options.map(o => o.renderOverviewRuler);
128128
this._sash = derivedWithStore('sash', (reader, store) => {
129129
const showSash = this._options.read(reader).renderSideBySide;
130130
this.elements.root.classList.toggle('side-by-side', showSash);
@@ -152,7 +152,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
152152

153153
this._register(autorunWithStore2('unchangedRangesFeature', (reader, store) => {
154154
this.unchangedRangesFeature = store.add(new (readHotReloadableExport(UnchangedRangesFeature, reader))(
155-
this._originalEditor, this._modifiedEditor, this._diffModel, this._options.map(o => o.renderSideBySide)
155+
this._originalEditor, this._modifiedEditor, this._diffModel, this._renderSideBySide,
156156
));
157157
}));
158158

@@ -161,7 +161,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
161161
this._originalEditor,
162162
this._modifiedEditor,
163163
this._diffModel,
164-
this._options.map((o) => o.renderSideBySide),
164+
this._renderSideBySide,
165165
this,
166166
() => this.unchangedRangesFeature.isUpdatingViewZones,
167167
));
@@ -257,7 +257,7 @@ export class DiffEditorWidget2 extends DelegatingEditor implements IDiffEditor {
257257
modifiedDecorations.push({ range: i.modifiedRange, options: diffAddDecoration });
258258
}
259259

260-
if (!m.lineRangeMapping.modifiedRange.isEmpty) {
260+
if (!m.lineRangeMapping.modifiedRange.isEmpty && this._renderSideBySide.read(reader) && !currentMove) {
261261
modifiedDecorations.push({ range: Range.fromPositions(new Position(m.lineRangeMapping.modifiedRange.startLineNumber, 1)), options: arrowRevertChange });
262262
}
263263
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export class ViewZoneManager extends Disposable {
262262
}
263263

264264
let marginDomNode: HTMLElement | undefined = undefined;
265-
if (a.diff && a.diff.modifiedRange.isEmpty) {
265+
if (a.diff && a.diff.modifiedRange.isEmpty && this._renderSideBySide.read(reader)) {
266266
marginDomNode = createViewZoneMarginArrow();
267267
}
268268

0 commit comments

Comments
 (0)