 
 class InnerRangeMarker extends RangeMarker
   @extend()
+
+# [TODO] This class expects member have "getRange = (selection) ->" method
+class UnionTextObject extends TextObject
+  @extend(false)
+  member: []
+
+  getUnionRange: (selection) ->
+    unionRange = null
+    for member in @member when range = @new(member).getRange(selection)
+      console.log [member, range?.toString()]
+      if unionRange?
+        unionRange = unionRange.union(range)
+      else
+        unionRange = range
+    unionRange
+
+  selectTextObject: (selection) ->
+    range = @getUnionRange(selection)
+    swrap(selection).setBufferRangeSafely(range)
+
+class AFunctionOrInnerParagraph extends UnionTextObject
+  @extend()
+  member: ['AFunction', 'InnerParagraph']

  getFoldRowRangesContainsForRow: (row) ->
    getCodeFoldRowRangesContainesForRow(@editor, row, true)?.reverse()

  selectTextObject: (selection) ->
    range = selection.getBufferRange()
    rowRanges = @getFoldRowRangesContainsForRow(range.start.row)
    return unless rowRanges?

    if (rowRange = rowRanges.shift())?
      rowRange = @adjustRowRange(rowRange)
      targetRange = getBufferRangeForRowRange(@editor, rowRange)
      if targetRange.isEqual(range) and rowRanges.length
        rowRange = @adjustRowRange(rowRanges.shift())
    if rowRange?
      swrap(selection).selectRowRange(rowRange)

class AFold extends Fold
  @extend()

      return row - 1
    lastRow

  getRange: (selection) ->
    @getRangeFromRow(selection.getBufferRange().start.row)

  getRangeFromRow: (startRow) ->
    isBlank = @editor.isBufferRowBlank.bind(@editor)
    wasBlank = isBlank(startRow)
    fn = (row) -> isBlank(row) is wasBlank
