From b26e0bcf39c1b8faaf770265391b5a387d1d9172 Mon Sep 17 00:00:00 2001 From: rebornix Date: Tue, 26 May 2020 08:07:51 -0700 Subject: [PATCH] send out missing selection change event when moving cells. --- src/vs/workbench/api/browser/mainThreadNotebook.ts | 1 + .../contrib/notebook/browser/contrib/coreActions.ts | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/vs/workbench/api/browser/mainThreadNotebook.ts b/src/vs/workbench/api/browser/mainThreadNotebook.ts index e9f673616bf..54e67c584d3 100644 --- a/src/vs/workbench/api/browser/mainThreadNotebook.ts +++ b/src/vs/workbench/api/browser/mainThreadNotebook.ts @@ -35,6 +35,7 @@ export class MainThreadNotebookDocument extends Disposable { this._textModel = new NotebookTextModel(handle, viewType, uri); this._register(this._textModel.onDidModelChange(e => { this._proxy.$acceptModelChanged(this.uri, e); + this._proxy.$acceptEditorPropertiesChanged(uri, { selections: { selections: this._textModel.selections }, metadata: null }); })); this._register(this._textModel.onDidSelectionChange(e => { const selectionsChange = e ? { selections: e } : null; diff --git a/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts b/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts index 69d0a1ad357..b997ba59d80 100644 --- a/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts +++ b/src/vs/workbench/contrib/notebook/browser/contrib/coreActions.ts @@ -469,10 +469,10 @@ export async function changeCellToKind(kind: CellKind, context: INotebookCellAct } export interface INotebookCellActionContext { - cellTemplate?: BaseCellRenderTemplate; - cell: ICellViewModel; - notebookEditor: INotebookEditor; - ui?: boolean; + readonly cellTemplate?: BaseCellRenderTemplate; + readonly cell: ICellViewModel; + readonly notebookEditor: INotebookEditor; + readonly ui?: boolean; } abstract class InsertCellCommand extends NotebookAction {