     @loaded = false
     @previousSource = @ace.getValue()
     @ace.setValue('')
+    @aceSession.setUndoManager(new UndoManager())
     fireURL = 'https://codecombat.firebaseio.com/' + @spell.pathComponents.join('/')
     @fireRef = new Firebase fireURL
     firepadOptions = userId: me.id

      @spell.source = firepadSource
    else
      @ace.setValue @previousSource
      @ace.clearSelection()
    @onAllLoaded()


{me} = require 'lib/auth'
filters = require 'lib/image_filter'
Range = ace.require('ace/range').Range
UndoManager = ace.require('ace/undomanager').UndoManager
Problem = require './Problem'
SpellDebugView = require './SpellDebugView'
SpellToolbarView = require './SpellToolbarView'
