     @aceSession = @ace.getSession()
     @aceDoc = @aceSession.getDocument()
     @aceSession.setUseWorker false
-    @aceSession.setMode 'ace/mode/javascript'
+    @aceSession.setMode @editModes[aceConfig.language ? 'javascript']
     @aceSession.setWrapLimitRange null
     @aceSession.setUseWrapMode true
     @aceSession.setNewLineMode "unix"

  controlsEnabled: true
  eventsSuppressed: true
  writable: true

  keyBindings:
    'default': null


  onChangeEditorConfig: (e) ->
    aceConfig = me.get 'aceConfig'
    @ace.setDisplayIndentGuides aceConfig.indentGuides # default false
    @ace.setShowInvisibles # default false
    @ace.setKeyboardHandler @keyBindings[aceConfig.keyBindings ? 'default']
    @aceSession.setMode @editModes[aceConfig.language ? 'javascript']

  dismiss: ->
    @recompile() if @spell.hasChangedSignificantly @getSource()
