     newPosition = [position.row, 0] if newPosition.isEqual(position)
     @setBufferPosition(newPosition)
 
-  # Public: Moves the cursor to the beginning of the buffer line, skipping all whitespace.
+  # Moves the cursor to the beginning of the buffer line, skipping all whitespace.
   skipLeadingWhitespace: ->
     position = @getBufferPosition()
     scanRange = @getCurrentLineBufferRange()


    beginningOfNextWordPosition or currentBufferPosition

  # Public: Gets the word located under the cursor.
  #
  # options - An object with properties based on {.getBeginningOfCurrentWordBufferPosition}.
  #


    @setBufferPosition(endOfLeadingWhitespace) if endOfLeadingWhitespace.isGreaterThan(position)

  # Moves the cursor to the end of the buffer line.
  moveToEndOfLine: ->
    @setBufferPosition([@getBufferRow(), Infinity])

  # Moves the cursor to the beginning of the word.
  moveToBeginningOfWord: ->
    @setBufferPosition(@getBeginningOfCurrentWordBufferPosition())

  # Moves the cursor to the end of the word.
  moveToEndOfWord: ->
    if position = @getEndOfCurrentWordBufferPosition()
      @setBufferPosition(position)

  # Moves the cursor to the beginning of the next word.
  moveToBeginningOfNextWord: ->
    if position = @getBeginningOfNextWordBufferPosition()
      @setBufferPosition(position)

  # Retrieves the buffer position of where the current word starts.
  #
  # options - A hash with one option:
  #           :wordRegex - A {RegExp} indicating what constitutes a "word" (default: {wordRegExp})
