     ranges = @getRanges(selection)
     _.last(sortRanges(ranges)) if ranges.length
 
-  select: ->
-    @eachSelection (s) =>
-      swrap(s).setBufferRangeSafely @getNearestRange(s)
+  selectTextObject: (selection) ->
+    swrap(selection).setBufferRangeSafely @getNearestRange(selection)
 
 class AAnyPair extends AnyPair
   @extend()

# -------------------------
class Entire extends TextObject
  @extend(false)
  select: ->
    @eachSelection (selection) =>
      @editor.selectAll()

class AEntire extends Entire
  @extend()

  isLinewise: ->
    swrap.detectVisualModeSubmode(@editor) is 'linewise'

  select: ->
    for selection in @editor.getSelections()
      @selectTextObject(selection)
      {start, end} = selection.getBufferRange()
      if (end.column is 0) and swrap(selection).detectVisualModeSubmode() is 'characterwise'
        end = getEolBufferPositionForRow(@editor, end.row - 1)
        swrap(selection).setBufferRangeSafely([start, end])
    @emitDidSelect()

# -------------------------
# [FIXME] Need to be extendable.
class Word extends TextObject
  @extend(false)
  selectTextObject: (selection) ->
    wordRegex = @wordRegExp ? selection.cursor.wordRegExp()
    @selectInner(selection, wordRegex)
    @selectA(selection) if @isA()

  selectInner: (selection, wordRegex=null) ->
    selection.selectWord()
