         editSession.moveCursorRight()
         false
       else if autoCompleteOpeningBracket
-        editSession.insertText(text + @startPairMatches[text])
+        editSession.insertText(text + @pairedCharacters[text])
         editSession.moveCursorLeft()
         range = [cursorBufferPosition, cursorBufferPosition.add([0, text.length])]
         @bracketMarkers.push editSession.markBufferRange(range)

        false

  wrapSelectionInBrackets: (editSession, bracket) ->
    pair = @startPairMatches[bracket]
    editSession.mutateSelectedText (selection) =>
      return if selection.isEmpty()



module.exports =
class BracketMatcher extends AtomPackage
  pairedCharacters:
    '(': ')'
    '[': ']'
    '{': '}'
    '"': '"'
    "'": "'"

  startPairMatches:
    '(': ')'
    '[': ']'
    '{': '}'

  endPairMatches:
    ')': '('
    ']': '['
    '}': '{'

  pairHighlighted: false

