From 8212eecec76499dc090a6caab9c8486067d8c5ad Mon Sep 17 00:00:00 2001 From: Lucy Zhang Date: Wed, 20 Oct 2021 13:51:27 -0700 Subject: [PATCH] add listener for celltype change (#17414) --- .../workbench/contrib/notebook/browser/cellToolbarActions.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sql/workbench/contrib/notebook/browser/cellToolbarActions.ts b/src/sql/workbench/contrib/notebook/browser/cellToolbarActions.ts index 29c42ec2c8..3156cd1f23 100644 --- a/src/sql/workbench/contrib/notebook/browser/cellToolbarActions.ts +++ b/src/sql/workbench/contrib/notebook/browser/cellToolbarActions.ts @@ -82,6 +82,9 @@ export class SplitCellAction extends CellActionBase { this._register(context.cell.onCurrentEditModeChanged(currentMode => { this.enabled = currentMode === CellEditModes.WYSIWYG ? false : true; })); + this._register(context.cell.notebookModel.onCellTypeChanged(_ => { + this.enabled = context.cell.currentMode === CellEditModes.WYSIWYG ? false : true; + })); } }