-
Notifications
You must be signed in to change notification settings - Fork 57
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: checking for winid value before to evoke it #203
Conversation
Sorry for not getting to this sooner. But it's odd to me that this is necessary, since this function is quite clearly documented in the API: https://github.com/nvim-tree/nvim-tree.lua/blob/f39f7b6fcd3865ac2146de4cb4045286308f2935/doc/nvim-tree-lua.txt#L1720-L1730 Can you please let me know which version of nvim-tree you are using? |
Thank you for answering me. |
Can you please give me a minimal nvim config that reproduces this issue? I'm not able to reproduce it myself, using nvim-tree with I don't see any reason for the |
Sure. |
Is the problem unique to using LunarVim? If not, can you please provide a minimal config that does not involve installing a whole Neovim distro? |
I ended up digging into this myself, and found the issue: LunarVim does not use rolling plugin releases, and instead uses the commit hashes from its So in fact, you are probably not on v0.99 of nvim-tree, which was released on Dec 31, 2023. (I say "probably" because I find it odd that nvim-tree does not have any other releases aside from v0.99, so perhaps I misunderstand their versioning model and "previously released" v0.99 and later moved the tag forward on NYE.) Since this means there are users of outdated nvim-tree, we should indeed check for whether |
You are correct, @j-hui, 0.99 is the only ever released version of nvim-tree. |
@victorfds please pull and make sure that this fixes your issue. If so, I'll go ahead and merge. |
It works perfectly! |
To handle the error below:
I noticed in the original code that the
winid
property was invoked (with()
) even when it wasnil
.The refined code incorporates a validation step to ensure that the function is called exclusively when a valid value is present.