Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sweng-group-15
yjs
Commits
44aa194d
Commit
44aa194d
authored
Nov 26, 2019
by
Moritz Langenstein
Browse files
(ml5717) Union struct first merge sync fix
parent
2942c3b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/Struct.js
View file @
44aa194d
...
...
@@ -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
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment