                 @editSession, currentRow)
         @editor.moveCursorToPosition position
         @editor.clearSelection()
+        @reIndenting = false
         return
 
     createBlankFunctionHeader: (command) ->


        if @editorConfig.buttons.length != 0
            buttonField = jQuery('<div>', {id: 'buttons'})

            if $.inArray('switchUp', @editorConfig.buttons) != -1
                buttonField.append '<button id="switchUp">Up</button>'

            if $.inArray('switchDown', @editorConfig.buttons) != -1
                buttonField.append '<button id="switchDown">Down</button>'

            if $.inArray('deleteLine', @editorConfig.buttons) != -1
                buttonField.append '<button id="deleteLine">Delete</button>'

            if $.inArray('insertButtons', @editorConfig.buttons) != -1
                buttonField.append '<br />'
                buttonField.append jQuery('<div>', {
                    id: 'insertButtons'}).get(0)

            buttonField.append '<br />'
            editorDiv.append buttonField.get 0

        editorDiv.append '<div id="parameter-pop-up" class="pop-up-container"></div>'

        @editor = new PlayerCodeEditor 'ace-editor', \
            @commands, @codeConfig.initial, @codeConfig.show, @codeConfig.prefix, \
            @codeConfig.postfix, @editorConfig.freeformEditting

        @reIndentCode()
        return

    reIndentCode: =>
        @reIndenting = true
        position = @editor.getCursorPosition()
        text = @editSession.getDocument()
        mode = @editSession.getMode()
