   getIndex
   smartScrollToBufferPosition
   getKeystrokeForEvent
+  pointIsAtEndOfLineAtNonEmptyRow
+  pointIsAtVimEndOfFile
+  getEndOfLineForBufferRow
 } = require './utils'
 
 swrap = require './selection-wrapper'

  # operator and the last word moved over is at the end of a line, the end of
  # that word becomes the end of the operated text, not the first word in the
  # next line.

  moveCursor: (cursor) ->
    return if cursorIsAtVimEndOfFile(cursor)
    wasOnWhiteSpace = cursorIsOnWhiteSpace(cursor)
    @moveCursorCountTimes cursor, ({isFinal}) =>
      cursorRow = cursor.getBufferRow()
      if cursorIsAtEmptyRow(cursor) and @isAsOperatorTarget()
        point = [cursorRow + 1, 0]
      else
        point = @getPoint(cursor)
        if isFinal and @isAsOperatorTarget()
          if @getOperator().is('Change') and (not wasOnWhiteSpace)
            point = cursor.getEndOfCurrentWordBufferPosition({@wordRegex})
          else if (point.row > cursorRow)
            point = [cursorRow, Infinity]
        else
      cursor.setBufferPosition(point)

# b

# -------------------------
class MoveToNextWholeWord extends MoveToNextWord
  @extend()
  wordRegex: /^\s*?$|\S+/g

class MoveToPreviousWholeWord extends MoveToPreviousWord
  @extend()
