fix edge case when moving backwards from move operation
This commit is contained in:
parent
f65d1b8475
commit
285dc79a6b
@ -199,7 +199,11 @@ export class ListIterator {
|
|||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
let item = this.nextItem
|
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
|
this.rel = 0
|
||||||
while (item && len > 0) {
|
while (item && len > 0) {
|
||||||
if (item.countable && !item.deleted && item.moved === this.currMove) {
|
if (item.countable && !item.deleted && item.moved === this.currMove) {
|
||||||
|
@ -668,7 +668,7 @@ const compareTestobjects = cmp => {
|
|||||||
* @param {t.TestCase} tc
|
* @param {t.TestCase} tc
|
||||||
*/
|
*/
|
||||||
export const testRepeatGeneratingYarrayTests6 = tc => {
|
export const testRepeatGeneratingYarrayTests6 = tc => {
|
||||||
compareTestobjects(applyRandomTests(tc, arrayTransactions, 9, monitorArrayTestObject))
|
compareTestobjects(applyRandomTests(tc, arrayTransactions, 6, monitorArrayTestObject))
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user