From a0b90ac5e04ea9a0733b68062253a469994e170e Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Wed, 21 Feb 2024 16:25:42 -0800 Subject: [PATCH] Fix #205818. Fix race condition. (#205921) --- .../contrib/notebook/browser/view/cellParts/codeCell.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts b/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts index a74983b6b5fae..2333273262864 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts @@ -137,7 +137,6 @@ export class CodeCell extends Disposable { this._register(Event.runAndSubscribe(viewCell.onDidChangeLayout, this.updateForLayout.bind(this))); this._cellEditorOptions.setLineNumbers(this.viewCell.lineNumbers); - this._register(this._cellEditorOptions.onDidChange(() => this.updateCodeCellOptions(templateData))); templateData.editor.updateOptions(this._cellEditorOptions.getUpdatedValue(this.viewCell.internalMetadata, this.viewCell.uri)); } @@ -231,6 +230,8 @@ export class CodeCell extends Disposable { focusEditorIfNeeded(); } + + this._register(this._cellEditorOptions.onDidChange(() => this.updateCodeCellOptions(this.templateData))); }); }