 # Refactoring status: 95%
 {Range} = require 'atom'
-_    = require 'underscore-plus'
+_ = require 'underscore-plus'
 
 Base = require './base'
 swrap = require './selection-wrapper'

        stop()
    found

  getPairRange: (from, pair, what) ->
    range = null
    switch what
      when 'enclosed'
        open  = @findPair pair, {from,       @allowNextLine, nest: 1, which: 'open'}
        close = @findPair pair, {from: open, @allowNextLine, nest: 1, which: 'close'} if open?
      when 'next'
        close = @findPair pair, {from,        @allowNextLine, nest: 0, which: 'close'}
        open  = @findPair pair, {from: close, @allowNextLine, nest: 1, which: 'open'} if close?
      when 'previous' # FIXME but currently unused
        open  = @findPair pair, {from,       @allowNextLine, nest: 0, which: 'open'}
        close = @findPair pair, {from: open, @allowNextLine, nest: 1, which: 'close'} if open?
    if open and close
      range = new Range(open, close)
      range = range.translate([0, -1], [0, 1]) unless @isInner()
    range

  adjustRowRange: (startRow, endRow) ->
    if @isInner()
      startRow += 1
      endRow -= 1 unless @language in @indentScopedLanguages
    endRow += 1 if (@language in @omittingClosingCharLanguages)
    [startRow, endRow]

class AFunction extends Function
