         return
 
 
-class PlayerCodeEditor
+class window.PlayerCodeEditor
     ###
         Creates and provides functionality for an Ace editor representing player's code.
     ###

        text.removeLines currentRow, currentRow
        return

    insertLine: ({text, line, currentRow}) ->
        maxRow = @editSession.getLength()
        if currentRow + 1 < @codePrefixLength or currentRow + 1 >= maxRow - (@codeSuffixLength - 1)
            return

        printLine = (@createBlankFunctionHeader line) + ';'
        text.insertLines currentRow + 1, [printLine]

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

            When the student code changes, run it through the
            interpreter to figure out commands remaining.
        ###
        if @scanTimer?
            window.clearTimeout @scanTimer
            @scanTimer = null
        @scanTimer = window.setTimeout @scan, 500
        return

    scan: =>
        remaining = @interpreter.scanText @editor.getStudentCode()
        @UpdateCommandsStatus remaining

    UpdateCommandsStatus: (remaining) ->
        ###
