Skip to content

Commit 05b7caa

Browse files
committed
fix: deep clone outputs
1 parent e1c12c6 commit 05b7caa

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/notebooks/deepnote/deepnoteCellCopyHandler.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import {
88
window,
99
NotebookCellData,
1010
NotebookRange,
11-
env
11+
env,
12+
NotebookCellOutputItem,
13+
NotebookCellOutput
1214
} from 'vscode';
1315

1416
import { IExtensionSyncActivationService } from '../../platform/activation/types';
@@ -169,7 +171,9 @@ export class DeepnoteCellCopyHandler implements IExtensionSyncActivationService
169171

170172
// Copy outputs if present
171173
if (cellToCopy.outputs.length > 0) {
172-
newCell.outputs = cellToCopy.outputs.map((output) => output);
174+
newCell.outputs = cellToCopy.outputs.map(
175+
(o) => new NotebookCellOutput(o.items.map((i) => new NotebookCellOutputItem(i.data, i.mime)))
176+
);
173177
}
174178

175179
// Insert the new cell

0 commit comments

Comments
 (0)