 
           return
         
-        console.log 'before', parent
         # Log the undo operation
         addMicroUndoOperation
           type: 'blockMove'
           before: if parent? then parent.getSerializedLocation() else null
           after: if target? then target.getSerializedLocation() else null
+          displaced: if target?.type is 'socketStart' then target.socket.content().clone() else null
           block: block.clone()
+
+        if target?.type is 'socketStart'
+          target.socket.content().remove()
 
         block.moveTo target
 

                operation.block.moveTo target

                moveCursorToRaw operation.block.end
            when 'blockMoveToFloat'
              # Remove the block from the list of floating blocks
              @floatingBlocks.splice operation.floatingBlockIndex

              if operation.after?
                pos = @tree.getTokenAtLocation operation.after

                if operation.displaced?
                  pos.insert operation.displaced

                until pos.type is 'blockStart' then pos = pos.next
                pos.block.moveTo null
                
