 
   getPairInfo: (from) ->
     pairInfo = null
-    pattern = @getPattern()
-    closeRange = @findClose(from, pattern)
-    openRange = @findOpen(closeRange.end, pattern) if closeRange?
+    if @_newStyle
+      closeRange = @findClose(from)
+      openRange = @findOpen(closeRange.end) if closeRange?
+    else
+      pattern = @getPattern()
+      closeRange = @findClose(from, pattern)
+      openRange = @findOpen(closeRange.end, pattern) if closeRange?
 
     unless (openRange? and closeRange?)
       return null

  getLineTextToBufferPosition
} = require './utils'

# -------------------------
class Pair extends TextObject
  @extend(false)
  allowNextLine: false
  adjustInnerRange: true
  pair: null
  wise: 'characterwise'
  supportCount: true

  getPattern: ->
    [open, close] = @pair
    if open is close
      new RegExp("(#{_.escapeRegExp(open)})", 'g')
    else
      new RegExp("(#{_.escapeRegExp(open)})|(#{_.escapeRegExp(close)})", 'g')

  # Return 'open' or 'close'
  getPairState: ({matchText, range, match}) ->

          when match[1] then 'open'
          when match[2] then 'close'

  pairStateInBufferRange: (range, char) ->
    text = getLineTextToBufferPosition(@editor, range.end)
    escapedChar = _.escapeRegExp(char)
