Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Fix: Improved MoveOperation x MergeOperation transformation.
Browse files Browse the repository at this point in the history
  • Loading branch information
scofalik committed Aug 8, 2018
1 parent 98ab5b3 commit fb4cf24
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/model/operation/transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -1344,7 +1344,14 @@ setTransformation( MoveOperation, MergeOperation, ( a, b, context ) => {
// it would be a move operation that moves 0 nodes, so maybe it is better just to return no-op.
//
if ( a.howMany == 1 ) {
return getNoOp();
if ( !context.bWasUndone ) {
return getNoOp();
} else {
a.sourcePosition = Position.createFromPosition( b.graveyardPosition );
a.targetPosition = a.targetPosition._getTransformedByMergeOperation( b );

return [ a ];
}
}
}
}
Expand Down

0 comments on commit fb4cf24

Please sign in to comment.