Open olslash opened 2 years ago
Tested working on my side as well!.
There's an issue though. the hotkey is not working because Ctrl+G is doing a collision with an Anki hotkey. I propose . and . for both generate and delete. Also minor styling fixes:
editor.addButton(None, "generateRuby", lambda ed=editor: doIt(ed, generateRuby),
tip=_(u"Automatically generate furigana (Ctrl+.)"), keys=_(u"Ctrl+."), label=_(u"Generate readings")),
editor.addButton(None, "deleteRuby", lambda ed=editor: doIt(ed, deleteRuby),
tip=_(u"Mass delete furigana (Ctrl+,)"), keys=_(u"Ctrl+,"), label=_(u"Delete readings"))
makes sense to me
I looked through the source and didn't find any obvious conflicts with those, though there doesn't seem to be any system for coordinating hotkeys between different plugins so an issue could still exist in some cases.
but short of making a menu to allow customizing the keybinds, this seems like a good solution
I can copy/paste your fix into this changeset tonight unless you want to make a separate PR for it
I'm fine with doing it on the same PR, as to not create possible merge conflicts, makes everything clearer too.
getCurrentField()
instead ofwindow
when callinggetSelection()
anki-editable
webcomponent instead of the olddiv
ctrl+.
(add) andctrl+,
(delete) -ctrl+g
conflicts with a native bind in latest anki versions (thx to @shuugo for the patch)seems to work as expected now
cc @shuugo @mario-kromer @jcsirot