提交 f5eb98d5 编写于 作者: R rebornix

Fix ##93920. index in range.

上级 420bcd7c
......@@ -611,12 +611,20 @@ export class NotebookEditor extends BaseEditor implements INotebookEditor {
async moveCellDown(cell: ICellViewModel): Promise<void> {
const index = this.notebookViewModel!.getViewCellIndex(cell);
if (index === this.notebookViewModel!.viewCells.length - 1) {
return;
}
const newIdx = index + 1;
return this.moveCellToIndex(index, newIdx);
}
async moveCellUp(cell: ICellViewModel): Promise<void> {
const index = this.notebookViewModel!.getViewCellIndex(cell);
if (index === 0) {
return;
}
const newIdx = index - 1;
return this.moveCellToIndex(index, newIdx);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册