Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin only works in one window at a time #27

Closed
mdyan opened this issue Nov 5, 2023 · 2 comments · Fixed by #30
Closed

Plugin only works in one window at a time #27

mdyan opened this issue Nov 5, 2023 · 2 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@mdyan
Copy link

mdyan commented Nov 5, 2023

Describe the bug
Using Chinese Support in the New Card window and Browse window one after another causes Chinese Support to break in the first window.

To Reproduce
Steps to reproduce the behavior:

  1. Open Add Card Window and enable Chinese Support
  2. Open Browse window and enable Chinese Support
  3. In the browse window, Chinese Support to auto-fill a field
  • To simulate an edit, I delete the Definition field and allow Chinese Support to refill it
  1. Go back to Add Card Window and try to use Chinese Support to autofill a new word

Expected behavior
Word should auto fill

Screenshots
If applicable, add screenshots
螢幕擷取畫面 2023-11-05 144016
to help explain your problem.

Specs (please complete the following information):

  • OS: Windows 11
  • Anki Version v2.1.66
  • Chinese Support Version v0.16.0

Additional context
I'm so happy this project finally has a maintainer!

As far as I know this bug always existed in the Redux as well. I'm not knowledgeable enough about the Anki plugin system to know whether this is even fixable or not. If it seems like it is, I'd be willing to attempt to fix it myself.

@Gustaf-C
Copy link
Owner

Gustaf-C commented Nov 6, 2023

I just looked and there is a pull request for that on the redux version, so if you feel like giving it a shot I would very much appreciate it!

I am quite swamped with other things for the coming weeks, so I won't be able to take a stab at it for quite a while.

@Gustaf-C Gustaf-C added the bug Something isn't working label Nov 6, 2023
kieranlblack added a commit to kieranlblack/anki-chinese-support-3 that referenced this issue Nov 12, 2023
Previously when a note was modified, the plugin would manually reload the note in the editor. This commit modifies things to take advantage of the built in hook infrastructure to auto-reload the note.

As a bonus, this fixes a bug caused assuming only one editor would be open at a time and closes Gustaf-C#27.
@mdyan
Copy link
Author

mdyan commented Nov 12, 2023

@kieranlblack's approach is the right way forward, I think the method used in the previous pull request will leak memory

kieranlblack added a commit to kieranlblack/anki-chinese-support-3 that referenced this issue Nov 12, 2023
Previously when a note was modified, the plugin would manually reload the note in the editor. This commit modifies things to take advantage of the built in hook infrastructure to auto-reload the note.

As a bonus, this fixes a bug caused assuming only one editor would be open at a time and closes Gustaf-C#27.
Gustaf-C pushed a commit to kieranlblack/anki-chinese-support-3 that referenced this issue Nov 14, 2023
Previously when a note was modified, the plugin would manually reload the note in the editor. This commit modifies things to take advantage of the built in hook infrastructure to auto-reload the note.

As a bonus, this fixes a bug caused assuming only one editor would be open at a time and closes Gustaf-C#27.
kieranlblack added a commit to kieranlblack/anki-chinese-support-3 that referenced this issue Nov 14, 2023
Previously when a note was modified, the plugin would manually reload the note in the editor. This commit modifies things to take advantage of the built in hook infrastructure to auto-reload the note.

As a bonus, this fixes a bug caused assuming only one editor would be open at a time and closes Gustaf-C#27.
Gustaf-C pushed a commit to kieranlblack/anki-chinese-support-3 that referenced this issue Nov 15, 2023
Previously when a note was modified, the plugin would manually reload the note in the editor. This commit modifies things to take advantage of the built in hook infrastructure to auto-reload the note.

As a bonus, this fixes a bug caused assuming only one editor would be open at a time and closes Gustaf-C#27.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants