   getFirstCharacterBufferPositionForScreenRow
   getTextInScreenRange
   cursorIsAtEndOfLineAtNonEmptyRow
-  buildWordPatternByCursor
-  getNonWordCharactersForCursor
   getFirstCharacterColumForBufferRow
 
   debug

  getFirstCharacterPositionForRow: (row) ->
    new Point(row, getFirstCharacterColumForBufferRow(@editor, row))

  getParagraphBoundaryRow: (startRow, direction, fn) ->
    wasAtNonBlankRow = not @editor.isBufferRowBlank(startRow)
    for row in getBufferRows(@editor, {startRow, direction})
      isAtNonBlankRow = not @editor.isBufferRowBlank(row)
      if wasAtNonBlankRow isnt isAtNonBlankRow
        if fn?
          return row if fn?(isAtNonBlankRow)
        else
          return row
      wasAtNonBlankRow = isAtNonBlankRow

  getNextStartOfSentence: (fromPoint) ->
    scanRange = [fromPoint, @getVimEofBufferPosition()]
    foundPoint = null
    @editor.scanInBufferRange @sentenceRegex, scanRange, ({range, stop}) ->
      foundPoint = range.end
      stop()
    foundPoint

  getPoint: (fromPoint) ->
    vimEof = @getVimEofBufferPosition()
    foundPoint = @getNextStartOfSentence(fromPoint)

    if boundaryRow = @getParagraphBoundaryRow(fromPoint.row, 'next')
      paragraphBoundaryPoint = @getFirstCharacterPositionForRow(boundaryRow)
    paragraphBoundaryPoint ?= vimEof

    if foundPoint?
      Point.min(foundPoint, paragraphBoundaryPoint)
    else
      paragraphBoundaryPoint

class MoveToPreviousSentence extends MoveToNextSentence
  @extend()

#  - section boundary is also sentence boundary(ignore)
class MoveToNextSentence extends Motion
  @extend()
  sentenceRegex: ///(?:[\.!\?][\)\]"']*\s+)|(\n|\r\n)///g

  moveCursor: (cursor) ->
    point = cursor.getBufferPosition()
