Fix notebook cell collapse action

Fix #122318
This commit is contained in:
Rob Lourens 2021-04-28 07:47:00 -07:00
parent 1f913a81b1
commit 1e9c0a643e

View file

@ -1385,7 +1385,8 @@ abstract class ChangeNotebookCellMetadataAction extends NotebookCellAction {
const metadataDelta = this.getMetadataDelta();
const edits: ICellEditOperation[] = [];
for (const cell of context.selectedCells || []) {
const targetCells = (context.cell ? [context.cell] : context.selectedCells) ?? [];
for (const cell of targetCells) {
const index = textModel.cells.indexOf(cell.model);
if (index >= 0) {
edits.push({ editType: CellEditType.Metadata, index, metadata: { ...context.cell.metadata, ...metadataDelta } });