Skip to content

Commit 2a0465f

Browse files
authored
Fixes #209251 in recovery release. (#209900)
1 parent 1b39fd6 commit 2a0465f

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

src/vs/editor/browser/widget/diffEditor/diffEditorWidget.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ export class DiffEditorWidget extends DelegatingEditor implements IDiffEditor {
5757

5858
private readonly elements = h('div.monaco-diff-editor.side-by-side', { style: { position: 'relative', height: '100%' } }, [
5959
h('div.noModificationsOverlay@overlay', { style: { position: 'absolute', height: '100%', visibility: 'hidden', } }, [$('span', {}, 'No Changes')]),
60-
h('div.editor.original@original', { style: { position: 'absolute', height: '100%', zIndex: '1', } }),
61-
h('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', zIndex: '1', } }),
60+
h('div.editor.original@original', { style: { position: 'absolute', height: '100%', } }),
61+
h('div.editor.modified@modified', { style: { position: 'absolute', height: '100%', } }),
6262
h('div.accessibleDiffViewer@accessibleDiffViewer', { style: { position: 'absolute', height: '100%' } }),
6363
]);
6464
private readonly _diffModel = observableValue<DiffEditorViewModel | undefined>(this, undefined);

src/vs/editor/browser/widget/diffEditor/features/gutterFeature.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { IObservable, autorun, autorunWithStore, derived, observableFromEvent, o
1212
import { URI } from 'vs/base/common/uri';
1313
import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors';
1414
import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel';
15-
import { appendRemoveOnDispose, applyStyle } from 'vs/editor/browser/widget/diffEditor/utils';
15+
import { appendRemoveOnDispose, applyStyle, prependRemoveOnDispose } from 'vs/editor/browser/widget/diffEditor/utils';
1616
import { EditorGutter, IGutterItemInfo, IGutterItemView } from 'vs/editor/browser/widget/diffEditor/utils/editorGutter';
1717
import { ActionRunnerWithContext } from 'vs/editor/browser/widget/multiDiffEditor/utils';
1818
import { EditorOption } from 'vs/editor/common/config/editorOptions';
@@ -38,7 +38,7 @@ export class DiffEditorGutter extends Disposable {
3838

3939
public readonly width = derived(this, reader => this._hasActions.read(reader) ? width : 0);
4040

41-
private readonly elements = h('div.gutter@gutter', { style: { position: 'absolute', height: '100%', width: width + 'px', zIndex: '0' } }, []);
41+
private readonly elements = h('div.gutter@gutter', { style: { position: 'absolute', height: '100%', width: width + 'px' } }, []);
4242

4343
constructor(
4444
diffEditorRoot: HTMLDivElement,
@@ -50,7 +50,7 @@ export class DiffEditorGutter extends Disposable {
5050
) {
5151
super();
5252

53-
this._register(appendRemoveOnDispose(diffEditorRoot, this.elements.root));
53+
this._register(prependRemoveOnDispose(diffEditorRoot, this.elements.root));
5454

5555
this._register(addDisposableListener(this.elements.root, 'click', () => {
5656
this._editors.modified.focus();

src/vs/editor/browser/widget/diffEditor/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ export function appendRemoveOnDispose(parent: HTMLElement, child: HTMLElement) {
8282
});
8383
}
8484

85+
export function prependRemoveOnDispose(parent: HTMLElement, child: HTMLElement) {
86+
parent.prepend(child);
87+
return toDisposable(() => {
88+
parent.removeChild(child);
89+
});
90+
}
91+
8592
export function observableConfigValue<T>(key: string, defaultValue: T, configurationService: IConfigurationService): IObservable<T> {
8693
return observableFromEvent(
8794
(handleChange) => configurationService.onDidChangeConfiguration(e => {

0 commit comments

Comments
 (0)