       return if @isEscapedCharAtPoint(range.start)
       fn(event)
 
-  findOpen: (from,  pattern) ->
-    scanFunc = 'backwardsScanInBufferRange'
-    scanRange = new Range([0, 0], from)
+  findOpen: (from, pattern) ->
+    options =
+      scanFunc: 'backwardsScanInBufferRange'
+      scanRange: new Range([0, 0], from)
+      from: from
+      pattern: pattern
+
     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})
+    @findPair 'open', options, (event) =>
+      {range, stop} = event
+      if @getPairState(event) is 'close'
+        stack.push({range})
       else
         stack.pop()
-        if stack.length is 0
-          found = range
+        found = range if stack.length is 0
       stop() if found?
     found
 
   findClose: (from,  pattern) ->
-    scanFunc = 'scanInBufferRange'
-    scanRange = new Range(from, @editor.buffer.getEndPosition())
+    options =
+      scanFunc: 'scanInBufferRange'
+      scanRange: new Range(from, @editor.buffer.getEndPosition())
+      from: from
+      pattern: pattern
+
     stack = []
     found = null
-    @findPair 'close', {from, pattern, scanFunc, scanRange}, (event) =>
+    @findPair 'close', options, (event) =>
       {range, stop} = event
-      pairState = @getPairState(event)
-      if pairState is 'open'
-        stack.push({pairState, range})
+      if @getPairState(event) is 'open'
+        stack.push({range})
       else
         entry = stack.pop()
         if stack.length is 0
           if (openStart = entry?.range.start)
             if @allowForwarding
-              return if openStart.row > from.row
+              return if openStart.row isnt from.row
             else
               return if openStart.isGreaterThan(from)
           found = range

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

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


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