       if character?
         @delegate?.inputControllerWillPerformTyping()
         @responder?.insertString(character)
-        @setInputSummary(textAdded: character, didDelete: @responder?.selectionIsExpanded())
+        @setInputSummary(textAdded: character, didDelete: @selectionIsExpanded())
 
     dragenter: (event) ->
       event.preventDefault()

      if (composedString = event.data)?
        @delegate?.inputControllerWillPerformTyping()
        @responder?.insertString(composedString)
        @setInputSummary(textAdded: composedString, didDelete: @responder?.selectionIsExpanded())
      @mutationObserver.start()

  keys:

      left: (event) ->
        if @selectionIsInCursorTarget()
          event.preventDefault()
          @expandSelectionInDirection("backward")

      right: (event) ->
        if @selectionIsInCursorTarget()
          event.preventDefault()
          @expandSelectionInDirection("forward")

  deleteInDirection: (direction) ->
    @responder?.deleteInDirection(direction)
    @setInputSummary(didDelete: true)

  @proxyMethod "responder?.expandSelectionInDirection"
  @proxyMethod "responder?.selectionIsInCursorTarget"
  @proxyMethod "responder?.selectionIsExpanded"

extensionForFile = (file) ->
  file.type?.match(/\/(\w+)$/)?[1]

keyEventIsWebInspectorShortcut = (event) ->
  event.metaKey and event.altKey and not event.shiftKey and event.keyCode is 94
