   # Responder protocol
 
   insertText: (text, {updatePosition} = updatePosition: true) ->
-    @delegate?.compositionWillSetLocationRange?() if updatePosition
+    @notifyDelegateOfIntentionToSetLocationRange() if updatePosition
 
     range = @getLocationRange()
     @document.insertTextAtLocationRange(text, range)

      @insertText(text)

  deleteInDirectionWithGranularity: (direction, granularity) ->
    @delegate?.compositionWillSetLocationRange?()
    range = @getLocationRange()

    if range.isCollapsed()

      @setLocationRange({index, offset})

  insertPlaceholderBlock: ->
    @notifyDelegateOfIntentionToSetLocationRange()
    range = @getLocationRange()
    document = new Trix.Document [Trix.Block.createPlaceholder()]
    @insertDocument(document)
    @setLocationRange(index: range.end.index + 1, offset: 0)

  insertDocument: (document) ->
    @notifyDelegateOfIntentionToSetLocationRange()
    range = @getLocationRange()
    @document.insertDocumentAtLocationRange(document, range)

