ijgnd / anki__extended_tag_edit_add_dialog

2 stars 2 forks source link

compatibility with the add-on "Persistent Editor" #5

Closed ijgnd closed 4 years ago

ijgnd commented 4 years ago

The add-on "Persistent Editor" can be downloaded from ankiweb, the github is here.

see issue #4

"extended_tag_edit_add_dialog" doesn't work with older versions of "Persistent Editor". But for me "extended_tag_edit_add_dialog" works with "Persistent Editor" versions for Anki 2.1.31 or newer.

Workaround for older Anki verisons that can only use older versions of "Persistent Editor": You can open the tag window from the context menu with your mouse.

 

technical note: older versions of "Persistent Editor" subclass aqt.editcurrent.EditCurrent (whereas newer verisons don't) and the new __init__ doesn't call the original __init__.

I have this note in my source code: "addHook("setupEditorShortcuts", SetupShortcuts) doesn't work when editor is not focused, e.g. if focus is on tag line. So using an editor shortcut here is bad." source. So I wrapped AddCards.__init__, EditCurrent.__init__, and used addHook("browser.setupMenus").