   consolidate: ->
     pieces = []
     pendingPiece = @pieces[0]
+    attachments = []
 
     for piece in @pieces[1..]
       if pendingPiece.canBeConsolidatedWithPiece(piece)

    length

  getAttachments: ->
    for piece in @pieces when piece.attachment
      piece.attachment


        pieces.push(pendingPiece)
        pendingPiece = piece

      if attachment = pendingPiece.attachment
        attachments.push(attachment)

    pieces.push(pendingPiece) if pendingPiece?
    @setCachedAttachments(attachments)
    @pieces = pieces

  findIndexAndOffsetAtPosition: (position) ->
