提交 58d5e0ca 编写于 作者: R rebornix

fix #104176. more editing metadata protection.

上级 8ddb5d25
......@@ -799,7 +799,7 @@ registerAction2(class extends NotebookCellAction {
clipboardService.writeText(context.cell.getText());
const viewModel = context.notebookEditor.viewModel;
if (!viewModel) {
if (!viewModel || !viewModel.metadata.editable) {
return;
}
......@@ -828,7 +828,7 @@ registerAction2(class extends NotebookAction {
const viewModel = context.notebookEditor.viewModel;
if (!viewModel) {
if (!viewModel || !viewModel.metadata.editable) {
return;
}
......@@ -884,7 +884,7 @@ registerAction2(class extends NotebookCellAction {
const viewModel = context.notebookEditor.viewModel;
if (!viewModel) {
if (!viewModel || !viewModel.metadata.editable) {
return;
}
......
......@@ -1193,12 +1193,20 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditor
}
async splitNotebookCell(cell: ICellViewModel): Promise<CellViewModel[] | null> {
if (!this._notebookViewModel!.metadata.editable) {
return null;
}
const index = this._notebookViewModel!.getCellIndex(cell);
return this._notebookViewModel!.splitNotebookCell(index);
}
async joinNotebookCells(cell: ICellViewModel, direction: 'above' | 'below', constraint?: CellKind): Promise<ICellViewModel | null> {
if (!this._notebookViewModel!.metadata.editable) {
return null;
}
const index = this._notebookViewModel!.getCellIndex(cell);
const ret = await this._notebookViewModel!.joinNotebookCells(index, direction, constraint);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册