       @editAttachment(attachment)
       false
     else
-      @document.removeTextAtRange(range)
+      @setDocument(@document.removeTextAtRange(range))
       @setPosition(range[0])
 
   moveTextFromRange: (range) ->
     [position] = @getSelectedRange()
-    @document.moveTextFromRangeToPosition(range, position)
+    @setDocument(@document.moveTextFromRangeToPosition(range, position))
     @setSelectedRange(position)
 
   removeAttachment: (attachment) ->
     if range = @document.getRangeOfAttachment(attachment)
       @stopEditingAttachment()
-      @document.removeTextAtRange(range)
+      @setDocument(@document.removeTextAtRange(range))
       @setSelectedRange(range[0])
 
   removeLastBlockAttribute: ->


  insertDocument: (document = new Trix.Document) ->
    selectedRange = @getSelectedRange()
    @document.insertDocumentAtRange(document, selectedRange)

    startPosition = selectedRange[0]
    endPosition = startPosition + document.getLength()


  insertBlockBreak: ->
    selectedRange = @getSelectedRange()
    @setDocument(@document.insertBlockBreakAtRange(selectedRange))

    startPosition = selectedRange[0]
    endPosition = startPosition + 1
