 activeWindow = App.activeWindow
 
 ace = require 'ace/ace'
+
+{EditSession} = require 'ace/edit_session'
+{UndoManager} = require 'ace/undomanager'
 
 module.exports =
 class Editor extends Pane

    'Alt-Shift-.'     : 'end'
    'Ctrl-L'          : 'consolelog'

  initialize: ->
    @ace = ace.edit "editor"
    @ace.setTheme require "ace/theme/twilight"

      @ace.focus()
      @ace.resize()
    , timeout

  newSession: (code) ->
    doc = new EditSession code or ''
    doc.setUndoManager new UndoManager
    doc

  copy: ->
    editor = @ace
