Hopefully reducing memory usage of TextEditor to avoid out of memory exceptions