goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.84k stars 109 forks source link

Error detected while processing CursorMoved Autocommands #87

Closed sparkbuzz closed 2 years ago

sparkbuzz commented 2 years ago

Since this morning I'm getting the error from alpha_nvim below when starting Neovim, and I open NvimTree. I thought this might be related to some changes I made, so I rolled back to my master branch. Error is still there, seems it started since I last ran :PackerSync

Error detected while processing CursorMoved Autocommands for "":
E5108: Error executing lua ...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:490: Cursor position outside buffer
stack traceback:
[C]: in function 'nvim_win_set_cursor'
...are/nvim/site/pack/packer/start/alpha-nvim/lua/alpha.lua:490: in function 'move_cursor'
[string ":lua"]:1: in main chunk

Any ideas as to what might be causing this?

KokaKiwi commented 2 years ago

I git-bisect-ed nvim-tree.lua and found this bug is present since https://github.com/kyazdani42/nvim-tree.lua/commit/6da74679449897dd95eaecaefe8dea80fc7eb3de (https://github.com/kyazdani42/nvim-tree.lua/pull/967)

uncomfyhalomacro commented 2 years ago

I git-bisect-ed nvim-tree.lua and found this bug is present since kyazdani42/nvim-tree.lua@6da7467 (kyazdani42/nvim-tree.lua#967)

I can confirm.

gbprod commented 2 years ago

Same problem for me, There is an issue here : https://github.com/kyazdani42/nvim-tree.lua/issues/983

zhaopengme commented 2 years ago

+1

nishu-murmu commented 2 years ago

Recently I too got this same error, I thought I broke my config somewhere, cause I update it almost everyday, Is this a alpha.nvim bug? or nvim-tree bug?

goolord commented 2 years ago

here's the problem afaict

even if we thread the actual alpha window here instead of calling vim.api.nvim_get_current_win https://github.com/goolord/alpha-nvim/blob/1cea4543c11c89bd8ce6a2bd3cb1dceff4e3cfde/lua/alpha.lua#L484-L487, buggy behavior would persist since the problem is fundamentally that the active window is allowed to change inbetween a CursorMoved event being fired and finishing

personally, i'm just going to pin nvim-tree to a working commit in my config.

in https://github.com/kyazdani42/nvim-tree.lua/issues/983 users of vim-startify and dashboard.nvim are also encountering this bug, so I think it's fair to say it's a nvim-tree bug

i'll leave this open though, since i'm sure there's a huge overlap between 'people who use alpha' and 'people who use nvim-tree'

goolord commented 2 years ago
    use {
        'kyazdani42/nvim-tree.lua',
        commit = '3f4ed9b6c2598ab8304186486a05ae7a328b8d49',
        requires = { 'kyazdani42/nvim-web-devicons' },
    }

pinned to the commit before the one @KokaKiwi mentions and everything works, ty ^^

nishu-murmu commented 2 years ago
    use {
        'kyazdani42/nvim-tree.lua',
        commit = '3f4ed9b6c2598ab8304186486a05ae7a328b8d49',
        requires = { 'kyazdani42/nvim-web-devicons' },
    }

pinned to the commit before the one @KokaKiwi mentions and everything works, ty ^^

This works :+1:

goolord commented 2 years ago

seems to be fixed now in https://github.com/kyazdani42/nvim-tree.lua/commit/f7a6ddb72086bb44105864128ebf9943ac0325c1, nvim-tree guys work fast :9