diff --git a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts index 89acf93d97b71b..41d10f0cdc3578 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.ts @@ -1143,6 +1143,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD this.focusElement(cell); const selection = cellOptions.options?.selection; if (selection) { + cell.updateEditState(CellEditState.Editing, 'setOptions'); + cell.focusMode = CellFocusMode.Editor; await this.revealLineInCenterIfOutsideViewportAsync(cell, selection.startLineNumber); } else if (options?.cellRevealType === CellRevealType.NearTopIfOutsideViewport) { await this.revealNearTopIfOutsideViewportAync(cell);