         ###
         playerCodeEditor = @
         return ->
-            func.call playerCodeEditor
+            func.apply playerCodeEditor, arguments
             playerCodeEditor.editor.focus()
             return
 

                if i != numberOfInputs
                    underscoresForInputs += ', '

            button = jQuery '<button>', {
                id: command,
                text: "#{command}(#{underscoresForInputs})",
                click: (event) ->
                    alert "test"
            }
            buttons.push button.get 0
        buttonField.append buttons

        re = /^(.+)\(/
        return re.exec(line)[1]

    insertLine: ({text, line, currentRow}) ->
        command = @getCommandFromLine(line)
        if @commands[command]['used'] < @commands[command]['maxUses']
            @commands[command]['used']++

            inputsDiv = jQuery('#insertButtons')
            text.insertLines currentRow, [text]

            if text.getLength() == 2 and text.getLine(currentRow + 1) == ""
                text.removeNewLine currentRow
