Fix undo/redo bugs

Here is a list of current limitations for undo/redo. I’ll keep this updated as item fixes or new problems are mentioned below in comments.

  • highlight text, type braces or brackets, undo, and the text highlighting is also undone—just the typing should be undone and the highlighting should remain unless undo is invoked a 2nd time
  • undoing edits (sometimes?) takes the user out of edit mode, but it should not
  • highlight text, type three backticks, and undo typing one time—the three backticks at the front disappear, but only one of the end backticks disappear (two remain)

Closed topic as I think the undo/redo has largely been fixed in the latest releases. Let me know if not and we can reopen