Impossible to "undo" in note editor when you leave the app

Running on 8cdb978a03424009f396e6a7e9f2e209fcf6b576

Previously, “undo” was global to the whole note editor. I loved that.
Now, as soon as you leave the field, you can’t undo anything.
I just erased a field by accident, and pressed the tab key. This mean that my field content was irremediably lost while previously, I could always do ctrl+z

The problem occurs also if you put the focus in another app. I suspect it might be less often a problem for most people. However, when the setting is “when you move the cursor, the hovered window get the focus”, this cause “undo” to become unavailable very easily.

Yep, we’re aware of that issue.

We have to implement a custom Undo stack. It probably won’t make it into 2.1.50 (we’ve got enough changes already), but it is top priority.

1 Like

One temporary workaround is to open the HTML editor and undo from there. It has its own undo queue which is preserved on focus changes.

Actually, it even preserves too much, since it is note-agnostic in the browser (you can undo the field content to whatever note was open before).

Edit>Undo can also be used to revert the note to a previous state, but it looks like the new editor currently isn’t updating the active field properly in that case: editor does not refresh active field after note undone · Issue #1628 · ankitects/anki · GitHub

I guess we’ll need to fix that too :slight_smile: html editor's undo state persists on note change · Issue #1629 · ankitects/anki · GitHub