scottgigante / korean-support

Anki add-on providing support for Korean study
https://ankiweb.net/shared/info/1336389630
GNU General Public License v3.0
18 stars 5 forks source link

If the main field to search from is empty #17

Closed AnneUK closed 3 years ago

AnneUK commented 3 years ago

If the main field to search from is empty when the plugin runs on an auto fill-in card type, any other content that is automatically filled by the plugin gets deleted. Example: Sometimes I record things and that's the first thing I need to do when I open a new card is fill that field, because I use a plugin to find the most recent media file, and I've only got a few seconds to it. If I happen to be using a card type that is normally automated with the plugin, it deletes the sound file reference and I end up with an empty card. I think it happens when the plugin runs as I am filling that field, and by the time it returns the field is now filled up by my sound, and it deletes it.

But I think the behaviour should be: If the field to search from is empty, then the plugin should not try and fill other fields with emptyness, it should do nothing. And if it does anything it needs to add to the field, not delete what is in there at the time of filling up, so that it doesn't delete things that were created after the plugin started running the auto search.

Thank you for a great plugin.

scottgigante commented 3 years ago

This is by design, not a bug. By emptying the main field and hitting tab, you can intentionally remove the auto-filled fields. Sorry if that was not clear.

Nayelianne commented 9 months ago

Is there a proper way for an user to remove this functionality?

I commented out this section of the edit_behavior.py in an attempt to stop it from wiping everything, but I'm not a coder so I'm not sure if I might have broken something else besides just keeping it from wiping everything if the main field is blank. If anyone can confirm it for me I'd appreciate it, haha.

sublime_text_hUBD5du1IN

Would be nice if there was a setting for it for those not brave enough to dive into the files, though.