 
   moveCursor: (cursor) ->
     newRow = cursor.getBufferRow() + (@getCount(1) - 1)
-    cursor.setBufferPosition([newRow, 0])
+    cursor.setBufferPosition [newRow, 0]
 
 # Position cursor without scrolling., H, M, L
 # -------------------------


  isWholeWord: (cursor) ->
    char = cursor.getCurrentWordPrefix().slice(-1)
    AllWhitespace.test(char)

class MoveToNextWord extends Motion
  @extend()
  wordRegex: null

  moveCursor: (cursor) ->
    @countTimes =>
      current = cursor.getBufferPosition()

      next = if @options?.excludeWhitespace
        cursor.getEndOfCurrentWordBufferPosition(wordRegex: @wordRegex)
      else
        cursor.getBeginningOfNextWordBufferPosition(wordRegex: @wordRegex)

      return if @at('EOF', cursor)

      if @at('EOL', cursor)
        cursor.moveDown()
        cursor.moveToBeginningOfLine()
        cursor.skipLeadingWhitespace()
      else if current.isEqual(next)
        cursor.moveToEndOfWord()
      else
        cursor.setBufferPosition(next)

class MoveToNextWholeWord extends MoveToNextWord
  @extend()
  wordRegex: WholeWordOrEmptyLineRegex

class MoveToEndOfWord extends Motion
  @extend()
  wordRegex: null
  inclusive: true

  moveCursor: (cursor) ->
    @countTimes =>
      next = cursor.getEndOfCurrentWordBufferPosition(wordRegex: @wordRegex)
      next.column-- if next.column > 0

      if next.isEqual(cursor.getBufferPosition())
        cursor.moveRight()
        if @at('EOL', cursor)
          cursor.moveDown()
          cursor.moveToBeginningOfLine()

        next = cursor.getEndOfCurrentWordBufferPosition(wordRegex: @wordRegex)
        next.column-- if next.column > 0

      cursor.setBufferPosition(next)

class MoveToEndOfWholeWord extends MoveToEndOfWord
  @extend()
  wordRegex: WholeWordRegex

class MoveToNextParagraph extends Motion
  @extend()

settings = require './settings'
{SearchViewModel} = require './view'
Base = require './base'

class Motion extends Base
  @extend()
