         # We use the following heuristic: if the text ends in a newline character, then it's a line-oriented
         # paste, and should be pasted in at a line break.
         if /\n$/.test text
-          @runMovement backward, "lineboundary"
+          @runMovement backward, lineboundary
           @runMovement forward, "line" if direction == forward
           DomUtils.simulateTextEntry @element, text
           @runMovement backward, "line"

  extendSelection: ->
    initialDirection = @getDirection()
    for direction in [ initialDirection, @opposite[initialDirection] ]
      @runMovement direction, "lineboundary"
      @reverseSelection()

class CaretMode extends Movement

    else
      beforeText[0]

  nextCharacterIsWordCharacter: ->
    /[A-Za-z0-9_]/.test @nextCharacter()

  # Run a movement.  For convenience, the following three argument forms are available:
  #   @runMovement "forward word"
  #   @runMovement [ "forward", "word" ]
  #   @runMovement "forward", "word"
  #
  # The granularities are word, "line", "lineboundary", "sentence" and "paragraph".  In addition, we implement
  # the pseudo granularity "vimword", which implements vim-like word movement, for "w".
  #
  runMovement: (args...) ->
    # Normalize the various argument forms (to an array of two strings: direction and granularity).
    movement =
