Commit 44aa194d authored by Moritz Langenstein's avatar Moritz Langenstein
Browse files

(ml5717) Union struct first merge sync fix

parent 2942c3b3
......@@ -165,7 +165,7 @@ module.exports = function (Y/* :any */) {
o = (o.right == null) ? null : yield* this.getOperation(o.right)
} else { // left == null
parent = yield* this.getOperation(op.parent)
let startId = op.parentSub ? parent.map[op.parentSub] : parent.start
let startId = op.parentSub ? parent.map[op.parentSub] : (parent.struct == "Union" ? parent.union : parent.start)
start = startId == null ? null : yield* this.getOperation(startId)
o = start
}
......@@ -223,7 +223,7 @@ module.exports = function (Y/* :any */) {
yield* this.setOperation(left)
} else {
// set op.right from parent, if necessary
op.right = op.parentSub ? parent.map[op.parentSub] || null : parent.start
op.right = op.parentSub ? parent.map[op.parentSub] || null : (parent.struct == "Union" ? parent.union : parent.start)
}
// reconnect right
if (op.right != null) {
......@@ -256,6 +256,11 @@ module.exports = function (Y/* :any */) {
if (op.left != null) {
yield* this.deleteOperation(op.id, 1, true)
}
} else if (parent.struct == "Union") {
if (left == null) {
parent.union = op.id
yield* this.setOperation(parent)
}
} else {
if (right == null || left == null) {
if (right == null) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment