   inputContainsASelectionRange: ->
     @input.selectionStart? and @input.selectionEnd? and @input.selectionStart != @input.selectionEnd
 
-  # Return the text of the input, with any selected text renage removed.
+  # Return the text of the input, with any selected text removed.
   getInputWithoutSelectionRange: ->
     if @inputContainsASelectionRange()
       @input.value[0...@input.selectionStart] + @input.value[@input.selectionEnd..]

    @input.value = query + completion
    @input.setSelectionRange query.length, query.length + completion.length

  #
  # Returns the user's action ("up", "down", "tab", "enter", "dismiss", "delete" or null) based on their
  # keypress.
  # We support the arrow keys and other shortcuts for moving, so this method hides that complexity.
  #
  actionFromKeyEvent: (event) ->
    key = KeyboardUtils.getKeyChar(event)
    if (KeyboardUtils.isEscape(event))


    completion = suggestions[0].slice query.length, length

    # Don't complete trailing whitespace, strip it.  Then, verify that the completion is still long enough.
    completion = completion.replace /\s+$/, ""
    return unless 0 < completion.length

