From 982bfc2334df8a076aa1c43654a4e95a57523e2a Mon Sep 17 00:00:00 2001 From: Alex Dima Date: Tue, 10 Nov 2020 22:00:24 +0100 Subject: [PATCH] Update decorations synchronously when the wrapping info changes --- src/vs/editor/browser/widget/diffEditorWidget.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index e77d846a845..d988120e6b0 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -516,9 +516,13 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE if (!editor.getModel()) { return; } - if (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.wrappingInfo)) { + if (e.hasChanged(EditorOption.fontInfo)) { this._updateDecorationsRunner.schedule(); } + if (e.hasChanged(EditorOption.wrappingInfo)) { + this._updateDecorationsRunner.cancel(); + this._updateDecorations(); + } })); this._register(editor.onDidChangeModelContent(() => { @@ -574,9 +578,13 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE if (!editor.getModel()) { return; } - if (e.hasChanged(EditorOption.fontInfo) || e.hasChanged(EditorOption.wrappingInfo)) { + if (e.hasChanged(EditorOption.fontInfo)) { this._updateDecorationsRunner.schedule(); } + if (e.hasChanged(EditorOption.wrappingInfo)) { + this._updateDecorationsRunner.cancel(); + this._updateDecorations(); + } })); this._register(editor.onDidChangeModelContent(() => {