       true
 
 class MoveDown extends MoveVertically
-  nextValidRow: (count) ->
-    @nextValidRowWithIncrement(count, 1)
+  # Internal: The direction to move the cursor. Use -1
+  # for moving up, 1 for moving down.
+  #
+  # Returns 1
+  directionIncrement: ->
+    1
 
   move: (count) ->
     @editor.moveCursorDown(count)

  #
  # count - The number of folded 'buffer' rows away from
  #         the current row.
  # increment - The direction to move the cursor. Use -1
  #             for moving up, 1 for moving down.
  #
  # Returns an integer row index.
  nextValidRowWithIncrement: (count, increment) ->
    {row, column} = @editor.getCursorBufferPosition()
    e = @editor

    maxRow = @editor.getLineCount()
    minRow = 0

    # For each count, subtract 1 row. Folded rows
    # count as a single row.
    _.times count, ->
      if e.isFoldedAtBufferRow(row)
        while e.isFoldedAtBufferRow(row)
          row += increment
      else
        row += increment

    if row > maxRow
      maxRow

      row

class MoveUp extends MoveVertically
  # Internal: The direction to move the cursor. Use -1
  # for moving up, 1 for moving down.
  #
  # Returns -1
  directionIncrement: ->
    -1

  select: (count=1) ->
    _.times count, =>
