correct errors not being highlighted when program loaded

when the text of the edit box is set when a program is loaded, the
cursor becomes invalid, so any errors set during the set do not get
displayed

the setPlainText() function was reimplemented in the edit box so the
cursor valid flag can be set to false until after the text is set when
the cursor is valid again (is moved once the document is set)