correctly handle gc with UndoManager and un-merge when syncing

This commit is contained in:
Kevin Jahns
2018-04-23 13:25:30 +02:00
parent ef6eb08335
commit 94933a704d
10 changed files with 38 additions and 15 deletions

View File

@@ -36,7 +36,6 @@ export default class GC {
n._length += next._length
y.os.delete(next._id)
}
if (id.user !== RootFakeUserID) {
if (y.connector !== null && (y.connector._forwardAppliedStructs || id.user === y.userID)) {
y.connector.broadcastStruct(this)
@@ -85,4 +84,11 @@ export default class GC {
_splitAt () {
return this
}
_clonePartial (diff) {
const gc = new GC()
gc._id = new ID(this._id.user, this._id.clock + diff)
gc._length = this._length - diff
return gc
}
}