The undo / Redo is not reliable and risky.
There is no abvious way to assume what the result will come up after invoking undo, the software get confused as to what to undo or redo, and you end up with no way to retrieve text you may've written.
Try doing it multiple times and your typing is gone for good.
It looks as if the Redo command starts the probelm, or starts the "forgetting" action, which mess up the code.
Version 6.1.054, purchased