-AceAdaptor = require 'ace-adaptor'
 Range = require 'range'
 TextMateBundle = require 'text-mate-bundle'
 _ = require 'underscore'

    "'": "'"

  constructor: (@editSession) ->
    @buffer = @editSession.buffer
    @aceMode = @requireAceMode()

    @grammar = TextMateBundle.grammarForFileName(@editSession.buffer.getBaseName())
    @aceAdaptor = new AceAdaptor(@editSession)

    _.adviseBefore @editSession, 'insertText', (text) =>
      return true if @editSession.hasMultipleCursors()

        @editSession.insertText text + pairedCharacter
        @editSession.moveCursorLeft()
        false

  isOpenBracket: (string) ->
    @pairedCharacters[string]?
