|
|
@@ -1241,7 +1241,7 @@ setTransformation( MergeOperation, MergeOperation, ( a, b, context ) => {
|
|
|
// Handle positions in graveyard.
|
|
|
// If graveyard positions are same and `a` operation is strong - do not transform.
|
|
|
if ( !a.graveyardPosition.isEqual( b.graveyardPosition ) || !context.aIsStrong ) {
|
|
|
- a.graveyardPosition._getTransformedByInsertion( b.graveyardPosition, 1 );
|
|
|
+ a.graveyardPosition = a.graveyardPosition._getTransformedByMergeOperation( b );
|
|
|
}
|
|
|
|
|
|
return [ a ];
|
|
|
@@ -1475,7 +1475,7 @@ setTransformation( MergeOperation, UnwrapOperation, ( a, b, context ) => {
|
|
|
// Handle positions in graveyard.
|
|
|
// If graveyard positions are same and `a` operation is strong - do not transform.
|
|
|
if ( !a.graveyardPosition.isEqual( b.graveyardPosition ) || !context.aIsStrong ) {
|
|
|
- a.graveyardPosition._getTransformedByInsertion( b.graveyardPosition, 1 );
|
|
|
+ a.graveyardPosition = a.graveyardPosition._getTransformedByUnwrapOperation( b );
|
|
|
}
|
|
|
|
|
|
return [ a ];
|
|
|
@@ -2205,7 +2205,7 @@ setTransformation( SplitOperation, WrapOperation, ( a, b ) => {
|
|
|
// was transformed by `UnwrapOperation` and it was left in the unwrapped node. Now the unwrapped node will be re-used
|
|
|
// and we need to fix `howMany` property in the `SplitOperation`.
|
|
|
//
|
|
|
- if ( b.graveyardPosition && a.insertionPosition.isEqual( b.graveyardPosition.getShiftedBy( 1 ) ) ) {
|
|
|
+ if ( b.graveyardPosition && compareArrays( b.graveyardPosition.path, a.position.getParentPath() ) == 'same' ) {
|
|
|
a.position = a.position._getCombined( b.graveyardPosition, b.position );
|
|
|
a.howMany = a.howMany + b.howMany;
|
|
|
|