This question has moved to Skulpt and CodeMirror Issues because the answers I had did not answer the question.
Downloading and Uploading in CodeMirror Textarea and Skulpt Execution Issues
2.4k Views Asked by AudioBubble At
2
There are 2 best solutions below
2

Use editor.getValue()
and editor.setValue(textFromFileLoaded)
rather than getting/setting the value of the "textbox" element itself.
A CodeMirror instance is almost entirely separate from the textarea it is constructed from. As you've seen, it won't notice changes made in the textarea, and won't propagate changes made in the editor to it (except specifically during a form submission).
Here is the code snippet
Open the snippet in a new window and Run it. It works well.
Here is the full code