several DS fixes (logging works now)

This commit is contained in:
Kevin Jahns
2017-10-26 16:22:35 +02:00
parent e8170a09a7
commit e6b5e258fb
7 changed files with 34 additions and 41 deletions

View File

@@ -103,15 +103,17 @@ export default class YArray extends Type {
let item = this._start
let count = 0
while (item !== null && length > 0) {
if (count <= pos && pos < count + item._length) {
const diffDel = pos - count
item = item._splitAt(this._y, diffDel)
item._splitAt(this._y, length)
length -= item._length
item._delete(this._y)
}
if (!item._deleted) {
count += item._length
if (count <= pos && pos < count + item._length) {
const diffDel = pos - count
item = item._splitAt(this._y, diffDel)
item._splitAt(this._y, length)
length -= item._length
item._delete(this._y)
count += diffDel
} else {
count += item._length
}
}
item = item._right
}