[Bug] Pressing Ctrl+Z in the HTML editor erases all content of the field

As the title says. You can reproduce it by opening the editor, (then clicking in a field), then opening the HTML editor and then pressing Ctrl+Z

Anki Version ⁨2.1.53 (96bacf79)⁩
Python 3.9.7 Qt 5.15.2 PyQt 5.15.5.

Tested without add-ons (startup with shift key held down).

1 Like

Ctrl+Z is buggy for me too.
(Version ⁨2.1.53 (96bacf79)⁩
Python 3.9.7 Qt 6.3.0 PyQt 6.3.0
Windows 10
All addons disabled)

I encountered the following problems:

  • it often does not undo the last action only, but also a few of the previous ones
  • it has no effect on text formatting; e.g. if I use Ctrl+U to underline some text I cannot undo it with Ctrl+Z
  • on a similar note: let’s say I write three words in the order Word1, Word2, Word3. I use Ctrl+U to underline Word2. Then I use Ctrl+Z and keep it pressed. In theory everything should be undone until the field is empty again. Instead, Word1 and Word3 eventually get deleted, while Word2 and its formatting are not.
  • most often, if I edit a field and then move the focus to another one, when I go back to the first field I cannot use Ctrl+Z to undo the edit

Perhaps related to Undo in the editor · Issue #1326 · ankitects/anki · GitHub