diff --git a/src/utils/ListIterator.js b/src/utils/ListIterator.js index 35d54324..d7601c1b 100644 --- a/src/utils/ListIterator.js +++ b/src/utils/ListIterator.js @@ -199,7 +199,11 @@ export class ListIterator { return this } let item = this.nextItem - len += ((item && item.countable && !item.deleted && item.moved === this.currMove) ? item.length : 0) - this.rel + if (item && item.content.constructor === ContentMove) { + item = item.left + } else { + len += ((item && item.countable && !item.deleted && item.moved === this.currMove) ? item.length : 0) - this.rel + } this.rel = 0 while (item && len > 0) { if (item.countable && !item.deleted && item.moved === this.currMove) { diff --git a/tests/y-array.tests.js b/tests/y-array.tests.js index e9c0c055..2a1b4452 100644 --- a/tests/y-array.tests.js +++ b/tests/y-array.tests.js @@ -668,7 +668,7 @@ const compareTestobjects = cmp => { * @param {t.TestCase} tc */ export const testRepeatGeneratingYarrayTests6 = tc => { - compareTestobjects(applyRandomTests(tc, arrayTransactions, 9, monitorArrayTestObject)) + compareTestobjects(applyRandomTests(tc, arrayTransactions, 6, monitorArrayTestObject)) } /**