提交 2fb3a3ef 编写于 作者: R Rob Lourens

Always focus a cell after deleting

上级 e7096586
......@@ -674,8 +674,9 @@ registerAction2(class extends Action2 {
if (result) {
// deletion succeeds, move focus to the next cell
if (index < context.notebookEditor.viewModel!.length) {
context.notebookEditor.focusNotebookCell(context.notebookEditor.viewModel!.viewCells[index], false);
const nextCellIdx = index < context.notebookEditor.viewModel!.length ? index : context.notebookEditor.viewModel!.length - 1;
if (nextCellIdx >= 0) {
context.notebookEditor.focusNotebookCell(context.notebookEditor.viewModel!.viewCells[nextCellIdx], false);
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册