This commit is contained in:
Erik De Bonte
2022-10-12 14:25:34 -07:00
parent 3ddce0580e
commit 4f32f4069d

View File

@@ -247,7 +247,7 @@ export class ExtHostNotebookDocument {
this._spliceNotebookCells(rawEvent.changes, false, result.contentChanges);
} else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.Move) {
this._moveCell(rawEvent.index, rawEvent.newIdx, result.contentChanges);
this._moveCells(rawEvent.index, rawEvent.length, rawEvent.newIdx, result.contentChanges);
} else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.Output) {
this._setCellOutputs(rawEvent.index, rawEvent.outputs);
@@ -387,8 +387,8 @@ export class ExtHostNotebookDocument {
}
}
private _moveCell(index: number, newIdx: number, bucket: vscode.NotebookDocumentContentChange[]): void {
const cells = this._cells.splice(index, 1);
private _moveCells(index: number, length: number, newIdx: number, bucket: vscode.NotebookDocumentContentChange[]): void {
const cells = this._cells.splice(index, length);
this._cells.splice(newIdx, 0, ...cells);
const changes = [
new RawContentChangeEvent(index, 1, cells.map(c => c.apiCell), []),