提交 ae56913b 编写于 作者: R rebornix

fix #99882. handle dragging position.

上级 f64150b9
......@@ -748,10 +748,10 @@ export class CellDragAndDropController extends Disposable {
private async moveCells(draggedCells: ICellViewModel[], ontoCell: ICellViewModel, direction: 'above' | 'below') {
this.notebookEditor.textModel!.pushStackElement('Move Cells');
if (direction === 'above') {
const relativeToIndex = this.notebookEditor!.viewModel!.getCellIndex(ontoCell);
const newIdx = relativeToIndex;
for (let i = 0; i < draggedCells.length; i++) {
const relativeToIndex = this.notebookEditor!.viewModel!.getCellIndex(ontoCell);
const newIdx = relativeToIndex;
for (let i = draggedCells.length - 1; i >= 0; i--) {
await this.notebookEditor.moveCellToIdx(draggedCells[i], newIdx);
}
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册