   historyUndo: (event) ->
 
   insertCompositionText: (event) ->
+    @composition = event.data
 
   insertFromComposition: (event) ->
+    delete @composition
+    @insertReplacementText(event)
 
   insertFromDrop: (event) ->
 

      console.log("[#{event.type}] #{JSON.stringify(event.data)}")
      Promise.resolve().then(console.groupEnd)

  # https://www.w3.org/TR/input-events-2/#interface-InputEvent-Attributes

  deleteByComposition: (event) ->

    {textAdded, textDeleted}

  insertReplacementText: (event) ->
    newText = event.data ? event.dataTransfer.getData("text/plain")
    oldText = getTargetText(event)
    {length} = oldText
    @delegate?.inputControllerWillPerformTyping()
