-
-
Notifications
You must be signed in to change notification settings - Fork 625
fix: Implicit current buf on centralize selection #1792
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
Conversation
|
Changed. I think it's also working correctly this way. |
Thanks, that's not exactly what I had in mind. Apologies for not being clear. I have requested changes with more detail. |
Didn't test it properly then. Schedule it then. Maybe Alex will have better solution. |
Should I revert to the explicit or the implicit implementation? |
If |
Gentle nudge for re-review @gegoune |
The recent implementation change to center the selected file produces a very odd error on my setup.
If I have
nvim-tree
open (for example, when opening an empty project) and then open a file using any other mean (e.g. Telescope) aInvalid buffer id: 1
error pops into my neovim.Tweaking the code I've discovered the cause: the
centralize_selection
autocmd that runs when closing the tree tries to reads thebufnr
of Telescope and then schedules thezz
call, running after some milliseconds when the Telescope buffer is already killed.By implicitly using the current buffer (by using
0
as a param) instead of explicitly retrieving it solves this problem. It'd probably also work if the retrieving is moved inside theschedule
function, but haven't tried as I don't think it's better to do so.