From c8c19aa7cde85b90bb16ddeb0abda8e87186f556 Mon Sep 17 00:00:00 2001 From: rebornix Date: Wed, 2 Sep 2020 12:13:13 -0700 Subject: [PATCH] reduce context key update. --- .../contrib/notebook/browser/viewModel/codeCellViewModel.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts b/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts index 0a7c21cf9be..06563a5b82a 100644 --- a/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts +++ b/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.ts @@ -224,8 +224,10 @@ export class CodeCellViewModel extends BaseCellViewModel implements ICellViewMod this.textModel = ref.object.textEditorModel; this._register(ref); this._register(this.textModel.onDidChangeContent(() => { - this.editState = CellEditState.Editing; - this._onDidChangeState.fire({ contentChanged: true }); + if (this.editState !== CellEditState.Editing) { + this.editState = CellEditState.Editing; + this._onDidChangeState.fire({ contentChanged: true }); + } })); }