Fixed undo not taking into account attributed strings

This bug caused font issues if you erased everything and hit undo