 
       if next.isEqual(current)
         cursor.moveRight()
-        if cursor.isAtEndOfLine()
+        if @at('EOL', cursor)
           cursor.moveDown()
           cursor.moveToBeginningOfLine()
 

      else
        cursor.setBufferPosition(next)

  isEndOfFile: (cursor) ->
    cur = cursor.getBufferPosition()
    eof = @editor.getEofBufferPosition()
    cur.row is eof.row and cur.column is eof.column

class MoveToNextWholeWord extends MoveToNextWord
  @extend()
  wordRegex: WholeWordOrEmptyLineRegex

class MoveLeft extends Motion
  @extend()
  moveCursor: (cursor) ->
    @countTimes =>
      if not @at('BOL', cursor) or settings.get('wrapLeftRightMotion')
        cursor.moveLeft()

class MoveRight extends Motion
