Pad: Fix copyPadWithoutHistory apool corruption bug

This commit is contained in:
Richard Hansen 2021-11-22 15:16:00 -05:00
parent ed78b56079
commit dab881139d
4 changed files with 96 additions and 5 deletions

View file

@ -492,10 +492,9 @@ Pad.prototype.copyPadWithoutHistory = async function (destinationID, force) {
// initialize the pad with a new line to avoid getting the defaultText
const newPad = await padManager.getPad(destinationID, '\n');
newPad.pool = sourcePad.pool.clone();
const oldAText = this.atext;
const newPool = newPad.pool;
newPool.fromJsonable(sourcePad.pool.toJsonable()); // copy that sourceId pool to the new pad
// based on Changeset.makeSplice
const assem = Changeset.smartOpAssembler();