Closed kanjieater closed 5 months ago
undo mechanism used in other add-ons
Would be helpful if you posted some code examples of that.
It's been a while since I had to update any of my add-ons so I may be out of date on the lastest and greatest ways (as I primarily write them without GUI's and have them rely on configuration files). But last I checked it seems like using the mw.checkpoint
is what sets up the current state to be a recoverable snapshot, that is registered into the standard undo flow.
Here's one such example, and i'm sure there's more in this repo https://github.com/glutanimate/anki-addons-misc/blob/7b981836e0a6637a1853f3e8d73d022ab95fed31/src/browser_replace_tag/browser_replace_tag.py#L49
Thanks, I'm gonna study the example and come back.
I believe we fixed this back in march.
In the browser, if you use the 再 or 振 hotkeys it and then hit the undo it will not undo. This can result in lost data or manual corrections to long definitions of words.
The request would be to use the standard undo mechanism used in anki and other add-ons to put things back to the state before one of these buttons was pressed.
Don't forget to provide:
1) OS name win 2) OS version 11 3) Anki version
4) Logs 5) Screenshots, if applicable