       screenRow += targetBufferRow - bufferRow
       [screenRow, screenRow + 1]
 
+  # This will return just the given buffer row if it is part of an iso region,
+  # but if it is part of a fold it will return the range of the entire fold. This
+  # helps the DisplayBuffer always start processing at the beginning of a fold
+  # for changes that occur inside the fold.
   bufferRowRangeForBufferRow: (targetBufferRow) ->
     { region, screenRow, bufferRow } = @traverseToBufferRow(targetBufferRow)
     if region and region.bufferRows != region.screenRows # 1:n region

        bufferRow += bufferRows
        index++

  applyScreenDelta: (startScreenRow, delta) ->
    return if delta is 0
    { index, screenRow } = @traverseToScreenRow(startScreenRow)

      bufferRow += targetScreenRow - screenRow
      [bufferRow, bufferRow + 1]

  # This method is used to create new regions, storing a mapping between a range
  # of buffer rows to a certain number of screen rows. It will never add or remove
  # rows in either coordinate space, meaning that it never changes the position
  # of subsequent regions. It will overwrite or split existing regions that overlap
  # with the region being stored however.
  mapBufferRowRange: (startBufferRow, endBufferRow, screenRows) ->
    { index, bufferRow, screenRow } = @traverseToBufferRow(startBufferRow)

