Skip to content

Commit b988b5c

Browse files
committed
协同编辑增加列的bug
1 parent 7728590 commit b988b5c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/controllers/server.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -703,16 +703,16 @@ const server = {
703703
}
704704
}
705705
else{
706-
file["column"] += len;
706+
file["column"] += len;
707707

708708
for(let i = 0; i < data.length; i++){
709-
// data[i].splice(st_i, 0, addData[i]);
710-
711-
// 备注:区分插入的位置(可能是左侧插入或者右侧插入)
712-
if(direction == "lefttop"){
713-
data[i].splice(st_i, 0, addData[i]);
714-
}else{
715-
data[i].splice(st_i + 1, 0, addData[i]);
709+
/* 在每一行的指定位置都插入一列 */
710+
for (let j = 0; j < len; j++) {
711+
if(direction == "lefttop"){
712+
data[i].splice(st_i, 0, addData[j]);
713+
}else{
714+
data[i].splice(st_i + 1, 0, addData[j]);
715+
}
716716
}
717717
}
718718
}

0 commit comments

Comments
 (0)