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

fix: do not replace non existing notifications + protect error-prone function calls #14

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zyriab
Copy link

@zyriab zyriab commented Feb 9, 2024

When I dismiss the "LSP loading" message, I have an infinite stream of "No matching notification found to replace" spamming me.
The problem was that the spinner was trying to replace the notification that I just dismissed, the solution was to set the self.notification to nil when closing the notification(s).

The next problem that arose was due to self.window having the same problem and triggering an error, the solution was to set it to nil as well, one particular call (line 208) sometimes was called before nvim-notify had the time to set self.window to nil, so I wrapped it in a pcall to suppress the error.

Lastly, it's a hack I've seen in other plugins but options.notify expects a string as first parameter (msg), passing an empty string causes the message to flicker when the spinner animates so it needs to stay nil.

My solution was topcall spinner_start (line 325).

I tried to change as little code as possible and this was the only way I've found to solve that bug.

This would fix #13

@zyriab
Copy link
Author

zyriab commented Feb 13, 2024

I got some errors because something is trying to access a nil value from time to time. I'll convert this PR to draft until this is fixed :)

@zyriab zyriab marked this pull request as draft February 13, 2024 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Getting "No matching notification found to replace" on neovim startup
1 participant