   # 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)
+    isAsOperatorTarget = @isAsOperatorTarget()
     @moveCursorCountTimes cursor, ({isFinal}) =>
-      cursorRow = cursor.getBufferRow()
-      if cursorIsAtEmptyRow(cursor) and @isAsOperatorTarget()
-        point = [cursorRow + 1, 0]
+      cursorPosition = cursor.getBufferPosition()
+      if cursorIsAtEmptyRow(cursor) and isAsOperatorTarget
+        point = cursorPosition.traverse([1, 0])
       else
-        point = @getPoint(cursor)
-        if isFinal and @isAsOperatorTarget()
+        pattern = @wordRegex ? cursor.wordRegExp()
+        point = @getPoint(pattern, cursorPosition)
+        if isFinal and isAsOperatorTarget
           if @getOperator().is('Change') and (not wasOnWhiteSpace)
             point = cursor.getEndOfCurrentWordBufferPosition({@wordRegex})
-          else if (point.row > cursorRow)
-            point = [cursorRow, Infinity]
-        else
+          else
+            point = Point.min(point, getEndOfLineForBufferRow(@editor, cursorPosition.row))
       cursor.setBufferPosition(point)
 
 # b

  getIndex
  smartScrollToBufferPosition
  getKeystrokeForEvent
} = require './utils'

swrap = require './selection-wrapper'

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

class MoveToPreviousWholeWord extends MoveToPreviousWord
  @extend()
