Stabilize Undo in Text Editor

I’m not sure if this a feature request or bug, but when I’m working in the PG text editor, sometimes the undo feature won’t undo the text in my editor but rather remove things in the PG page. It would be a big help in making the internal editor usable if the undo worked normally.