From b6419f37622b6208c32728d694c8a36071eaf7c7 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Wed, 26 Oct 2022 15:16:26 -0700 Subject: [PATCH] Fix #164715. Turn cell into editing mode when there is a selection. (#164758) --- .../workbench/contrib/notebook/browser/notebookEditorWidget.ts | 2 ++ 1 file changed, 2 insertions(+) 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);