     @blockList.replaceBlockList(document.blockList)
     @delegate?.didEditDocument?(this)
 
-  getCommonAttributesAtLocationRange: (range) ->
-    if range.isCollapsed()
-      @getCommonAttributesAtLocation(range.start)
+  getCommonAttributesAtLocationRange: (locationRange) ->
+    if locationRange.isCollapsed()
+      @getCommonAttributesAtLocation(locationRange.start)
     else
       textAttributes = []
       blockAttributes = []
 
-      @eachBlockAtLocationRange range, (block, textRange) ->
+      @eachBlockAtLocationRange locationRange, (block, textRange) ->
         textAttributes.push(block.text.getCommonAttributesAtRange(textRange))
         blockAttributes.push(block.getAttributes())
 


    @blockList = blockList

  replaceTextAtLocationRange: edit (text, range) ->
    @removeTextAtLocationRange(range)
    @insertTextAtLocation(text, range[0])

  addAttributeAtLocationRange: edit (attribute, value, locationRange) ->
    @eachBlockInLocationRange locationRange, (block, range, index) =>


        callback(block, textRange, index)

  insertTextAtLocationRange: edit (text, locationRange) ->
    @blockList = @blockList.editObjectAtIndex locationRange.index, (block) ->
      block.copyWithText(block.text.insertTextAtPosition(text, locationRange.position))

  removeTextAtLocationRange: edit (locationRange) ->
    range = @rangeFromLocationRange(locationRange)
    blockList = @blockList.removeObjectsInRange(range)

    leftIndex = locationRange.index
    rightIndex = leftIndex + 1
    leftBlock = blockList.getObjectAtIndex(leftIndex)
    rightBlock = blockList.getObjectAtIndex(rightIndex)
