   @extend(false)
   @description: "Range surrounded by auto-detected paired chars from enclosed and forwarding area"
   allowForwarding: true
-  skipEmptyPair: false
   searchFrom: 'start'
   getRange: (selection) ->
     ranges = @getRanges(selection)

      return if @isEscapedCharAtPoint(range.start)
      fn(event)

  findOpen: (from,  pattern) ->
    scanFunc = 'backwardsScanInBufferRange'
    scanRange = new Range([0, 0], from)
    stack = []
    found = null
    @findPair 'open', {from, pattern, scanFunc, scanRange}, (event) =>
      {matchText, range, stop} = event
      pairState = @getPairState(event)
      if pairState is 'close'
        stack.push({pairState, matchText, range})
      else
        stack.pop()
        if stack.length is 0
          found = range
      stop() if found?
    found

  findClose: (from,  pattern) ->
    scanFunc = 'scanInBufferRange'
    scanRange = new Range(from, @editor.buffer.getEndPosition())
    stack = []
    found = null
    @findPair 'close', {from, pattern, scanFunc, scanRange}, (event) =>
      {range, stop} = event
      pairState = @getPairState(event)
      if pairState is 'open'
        stack.push({pairState, range})
      else
        entry = stack.pop()
        if stack.length is 0
          if (openStart = entry?.range.start)
            if @allowForwarding
              return if openStart.row > from.row
            else
              return if openStart.isGreaterThan(from)
          found = range

  @extend(false)
  allowForwarding: false
  allowNextLine: null
  member: [
    'DoubleQuote', 'SingleQuote', 'BackTick',
    'CurlyBracket', 'AngleBracket', 'SquareBracket', 'Parenthesis'
  ]

  getRangeBy: (klass, selection) ->
    options = {@inner}
    options.allowNextLine = @allowNextLine if @allowNextLine?
    @new(klass, options).getRange(selection, {@allowForwarding, @searchFrom})

