Skip to content

Commit

Permalink
Fixes diff editor missing border bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Apr 8, 2024
1 parent a1815b9 commit e03ba6c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { IObservable, autorun, autorunWithStore, derived, observableFromEvent, o
import { URI } from 'vs/base/common/uri';
import { DiffEditorEditors } from 'vs/editor/browser/widget/diffEditor/components/diffEditorEditors';
import { DiffEditorViewModel } from 'vs/editor/browser/widget/diffEditor/diffEditorViewModel';
import { appendRemoveOnDispose, applyStyle } from 'vs/editor/browser/widget/diffEditor/utils';
import { appendRemoveOnDispose, applyStyle, prependRemoveOnDispose } from 'vs/editor/browser/widget/diffEditor/utils';
import { EditorGutter, IGutterItemInfo, IGutterItemView } from 'vs/editor/browser/widget/diffEditor/utils/editorGutter';
import { ActionRunnerWithContext } from 'vs/editor/browser/widget/multiDiffEditor/utils';
import { EditorOption } from 'vs/editor/common/config/editorOptions';
Expand Down Expand Up @@ -50,7 +50,7 @@ export class DiffEditorGutter extends Disposable {
) {
super();

this._register(appendRemoveOnDispose(diffEditorRoot, this.elements.root));
this._register(prependRemoveOnDispose(diffEditorRoot, this.elements.root));

this._register(addDisposableListener(this.elements.root, 'click', () => {
this._editors.modified.focus();
Expand Down
7 changes: 7 additions & 0 deletions src/vs/editor/browser/widget/diffEditor/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ export function appendRemoveOnDispose(parent: HTMLElement, child: HTMLElement) {
});
}

export function prependRemoveOnDispose(parent: HTMLElement, child: HTMLElement) {
parent.prepend(child);
return toDisposable(() => {
parent.removeChild(child);
});
}

export function observableConfigValue<T>(key: string, defaultValue: T, configurationService: IConfigurationService): IObservable<T> {
return observableFromEvent(
(handleChange) => configurationService.onDidChangeConfiguration(e => {
Expand Down

0 comments on commit e03ba6c

Please sign in to comment.