               @keyQueue = ""
               @selection = window.getSelection()
 
-              # If there's matching a command *and* a matching movement, then choose the command.
               if @commands[keyChar]
                 @commands[keyChar].call @
                 @scrollIntoView()

    @countPrefix = ""

  pasteClipboard: (direction) ->
    @protectClipboard =>
      @paste (text) =>
        if text
          lineOriented = text == Movement.lastLineSelection
          if lineOriented
            @runMovement "#{direction} lineboundary"
            text = if direction == forward then "\n" + text else text + "\n"
          DomUtils.simulateTextEntry @element, text
          @runMovement "backward line" if lineOriented

  openLine: (direction) ->
    @runMovement "#{direction} lineboundary"

    @copy @yankedText if @yankedText

  selectLine: ->
    direction = @getDirection()
    for direction in [ @opposite[direction], direction ]
      @runMovement "#{direction} lineboundary"
      @swapFocusAndAnchor()

  # Adapted from: http://roysharon.com/blog/37.
  # I have no idea how this works (smblott, 2015/1/22).
