   @extend()
   wordRegex: null
 
-  getPoint: (cursor) ->
-    cursorPoint = cursor.getBufferPosition()
-    pattern = @wordRegex ? cursor.wordRegExp()
-    scanRange = [cursorPoint, @getVimEofBufferPosition()]
-
+  getPoint: (pattern, fromPoint) ->
+    scanRange = new Range(fromPoint, @getVimEofBufferPosition())
     wordRange = null
     found = false
     @editor.scanInBufferRange pattern, scanRange, ({range, matchText, stop}) ->
       wordRange = range
       # Ignore 'empty line' matches between '\r' and '\n'
       return if matchText is '' and range.start.column isnt 0
-      if range.start.isGreaterThan(cursorPoint)
+      if range.start.isGreaterThan(fromPoint)
         found = true
         stop()
 
     if found
-      wordRange.start
-    else
-      wordRange?.end ? cursorPoint
+      point = wordRange.start
+      if pointIsAtEndOfLineAtNonEmptyRow(@editor, point) and not point.isEqual(scanRange.end)
+        point.traverse([1, 0])
+      else
+        point
+    else
+      wordRange?.end ? fromPoint
 
   # Special case: "cw" and "cW" are treated like "ce" and "cE" if the cursor is
   # on a non-blank.  This is because "cw" is interpreted as change-word, and a

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

class MoveToPreviousWholeWord extends MoveToPreviousWord
  @extend()

  getIndex
  smartScrollToBufferPosition
  getKeystrokeForEvent
  pointIsAtEndOfLineAtNonEmptyRow
  pointIsAtVimEndOfFile
  getEndOfLineForBufferRow
} = require './utils'

swrap = require './selection-wrapper'
