auto-reload & compile with internal editor preserve undo status

This is an extremely simple fix to the problem reported in #734