提交 08a33550 编写于 作者: R rebornix

remove clear all cell outputs

上级 8503905a
......@@ -1431,7 +1431,10 @@ registerAction2(class extends NotebookAction {
return;
}
editor.viewModel.notebookDocument.clearAllCellOutputs();
editor.viewModel.notebookDocument.applyEdit(editor.viewModel.notebookDocument.versionId,
editor.viewModel.notebookDocument.cells.map((cell, index) => ({
editType: CellEditType.Output, index, outputs: []
})), true);
}
});
......
......@@ -513,20 +513,6 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel
//#region Notebook Text Model Edit API
// TODO@rebornix should this trigger content change event?
clearCellOutput(handle: number) {
const cell = this._mapping.get(handle);
if (cell) {
cell.spliceNotebookCellOutputs([
[0, cell.outputs.length, []]
]);
this._increaseVersionId();
this._onDidModelChangeProxy.fire({ kind: NotebookCellsChangeType.CellClearOutput, versionId: this._versionId, index: this.cells.indexOf(cell) });
}
}
changeCellLanguage(handle: number, languageId: string) {
const cell = this._mapping.get(handle);
if (cell && cell.language !== languageId) {
......@@ -596,17 +582,6 @@ export class NotebookTextModel extends Disposable implements INotebookTextModel
}
}
clearAllCellOutputs() {
this.cells.forEach(cell => {
cell.spliceNotebookCellOutputs([
[0, cell.outputs.length, []]
]);
});
this._increaseVersionId();
this._onDidModelChangeProxy.fire({ kind: NotebookCellsChangeType.CellsClearOutput, versionId: this._versionId });
}
createCell(index: number, source: string, language: string, type: CellKind, metadata: NotebookCellMetadata | undefined, synchronous: boolean, pushUndoStop: boolean, beforeSelections: number[] | undefined, endSelections: number[] | undefined) {
const cell = this.createCellTextModel(source, language, type, [], metadata);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册