neo-tree.nvim
neo-tree.nvim copied to clipboard
Conflict between alpha.nvim and preview feature
Greatest feature! When there's no open buffer (such as starting with the alpha-nvim greeting), disabling preview causes some errors: Other than that, it works great.
E5108: Error executing lua: ...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:150: Vim(append):Error executing lua callback: ..
.are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:550: Cursor position outside buffer
stack traceback:
[C]: in function 'nvim_win_set_cursor'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:550: in function 'draw'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:566: in function 'redraw'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:473: in function <...are/nvim/site/pack/packer/start/alpha-nvim/lua/a
lpha.lua:473>
[C]: in function 'nvim_win_set_buf'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:150: in function 'setBuffer'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:73: in function 'revert'
...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:400: in function 'func'
.../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:695: in function <.../packer/start/neo-tree.nvim/lua/neo-tree/ui/rend
erer.lua:693>
stack traceback:
[C]: in function 'nvim_win_set_buf'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:150: in function 'setBuffer'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:73: in function 'revert'
...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:400: in function 'func'
.../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:695: in function <.../packer/start/neo-tree.nvim/lua/neo-tree/ui/rend
erer.lua:693>
Originally posted by @barreiroleo in https://github.com/nvim-neo-tree/neo-tree.nvim/issues/482#issuecomment-1217084511
@barreiroleo @mrbjarksen
I don't have alpha.nvim
, but I'm pretty sure the fix I just pushed will prevent this error. Can you give it a try?
Yeah, works well :+1:
After update and reenable the preview command, the issue come up again.
E5108: Error executing lua: ...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:153: Vim(append):Error executing lua callback: ...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:550: Cursor position outside buffer
stack traceback:
[C]: in function 'nvim_win_set_cursor'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:550: in function 'draw'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:566: in function 'redraw'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:473: in function <...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:473>
[C]: in function 'nvim_win_set_buf'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:153: in function 'setBuffer'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:78: in function 'revert'
...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:379: in function 'func'
.../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:696: in function <.../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:694>
stack traceback:
[C]: in function 'nvim_win_set_buf'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:153: in function 'setBuffer'
...rt/neo-tree.nvim/lua/neo-tree/sources/common/preview.lua:78: in function 'revert'
...t/neo-tree.nvim/lua/neo-tree/sources/common/commands.lua:379: in function 'func'
.../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:696: in function <.../packer/start/neo-tree.nvim/lua/neo-tree/ui/renderer.lua:694>
Could it be that the issue is just inconsistent, and that's why it seemed to be fixed? You just got lucky on the last try?
I'm looking at the code for alpha.nvim, and I think this is really a bug in that project that was just revealed by this project. This is probably the only situation where the alpha.nvim is navigated away from and then back to again. I see three possible solutions:
- Set
redraw_on_resize = false
in your alpha.nvim config, this will disable the problematic code block. - Open an issue on the alpha.nvim project so that the
set_cursor
call can be changed to apcall
or otherwise checked for validity before being run. - I can put a special handler in place to never revert the buffer when alpha.nvim would be the target.
I have a 4th option: Don't use alpha anymore, haha
It isn't a necessary plugin really. For someone else, it might be helpful if alpha.nvim
resolves their bug. If it's not your responsibility, don't care about it.
I have a 4th option: Don't use alpha anymore, haha It isn't a necessary plugin really.
In that case, I'll just leave the issue open for others to find. If there is a lot of interest I might do option 2 or 3.