提交 ec1f0e32 编写于 作者: R rebornix

fix #104176.

上级 16fb610b
......@@ -399,6 +399,10 @@ export class NotebookService extends Disposable implements INotebookService, ICu
return false;
}
if (!viewModel.metadata.editable) {
return false;
}
const currCellIndex = viewModel.getCellIndex(activeCell);
let topPastedCell: CellViewModel | undefined = undefined;
......@@ -442,6 +446,10 @@ export class NotebookService extends Disposable implements INotebookService, ICu
return false;
}
if (!viewModel.metadata.editable) {
return false;
}
const clipboardService = accessor.get<IClipboardService>(IClipboardService);
const notebookService = accessor.get<INotebookService>(INotebookService);
clipboardService.writeText(activeCell.getText());
......
......@@ -1070,6 +1070,10 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
}
async undo() {
if (!this.metadata.editable) {
return;
}
const editStack = this._undoService.getElements(this.uri);
const element = editStack.past.length ? editStack.past[editStack.past.length - 1] : undefined;
......@@ -1083,6 +1087,10 @@ export class NotebookViewModel extends Disposable implements EditorFoldingStateD
}
async redo() {
if (!this.metadata.editable) {
return;
}
const editStack = this._undoService.getElements(this.uri);
const element = editStack.future[0];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册