 
   Editor::performFreezeAnimation = (fadeTime = 500, translateTime = 500, cb = ->)->
     if not @currentlyUsingBlocks and not @currentlyAnimating
-      @copyAceEditor()
-
-      @fireEvent 'statechange', [true]
-
-      setValueResult = @setValue_raw @aceEditor.getValue()
+      setValueResult = @copyAceEditor()
 
       unless setValueResult.success
         return setValueResult


        # Update the ace editor value to match,
        # but don't trigger a resize event.
        @suppressAceChangeEvent = true; oldScroll = @aceEditor.session.getScrollTop()
        console.log 'SET ACE @changeEventVersion'
        @aceEditor.setValue @getValue(), -1
        @suppressAceChangeEvent = false; @aceEditor.session.setScrollTop oldScroll

        @fireEvent 'change', []


    @aceEditor.getSession().setTabSize 2

    @aceEditor.on 'change', =>
      if @suppressAceChangeEvent then return
      if @currentlyUsingBlocks
        @changeFromAceEditor()
      else
        @fireEvent 'change', []

    @currentlyUsingBlocks = true
    @currentlyAnimating = false
