fidget.nvim icon indicating copy to clipboard operation
fidget.nvim copied to clipboard

fidget not robust against weird buffer situations

Open nxuv opened this issue 3 years ago • 10 comments

Error detected while processing BufUnload Autocommands for "*":                                                                                                                                             
E937: Attempt to delete a buffer that is in use: [No Name]
Press ENTER or type command to continue
Error detected while processing BufUnload Autocommands for "*":
Error executing vim.schedule lua callback: ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:91: Error occured:
...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:325: Failed to unload buffer.
stack traceback:
        [C]: in function 'error'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:91: in function 'render_fidgets'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:223: in function 'fmt'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:476: in function <...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:475>
        [C]: in function 'wait'
        .../packer/start/nvim-tree.lua/lua/nvim-tree/git/runner.lua:137: in function '_wait'
        .../packer/start/nvim-tree.lua/lua/nvim-tree/git/runner.lua:156: in function 'run'
        ...ck/packer/start/nvim-tree.lua/lua/nvim-tree/git/init.lua:47: in function 'reload_project'
        ...ck/packer/start/nvim-tree.lua/lua/nvim-tree/git/init.lua:31: in function 'reload'
        ...m-tree.lua/lua/nvim-tree/actions/reloaders/reloaders.lua:41: in function 'reload_explorer'
        ...m/site/pack/packer/start/nvim-tree.lua/lua/nvim-tree.lua:375: in function <...m/site/pack/packer/start/nvim-tree.lua/lua/nvim-tree.lua:373>
        [C]: in function 'nvim_buf_delete'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:325: in function 'close'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:103: in function <...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:97>
        [C]: in function 'pcall'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:86: in function 'render_fidgets'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:223: in function 'fmt'
        ...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:476: in function <...e/nvim/site/pack/packer/start/fidget.nvim/lua/fidget.lua:475>
Press ENTER or type command to continue

Fidget config:

require("fidget").setup({
    window = {
        blend = 0
    }
})

Primarily error is present when switching from Alpha dashboard to any file and then switching to Nvim-tree

nxuv avatar Dec 19 '22 09:12 nxuv

Wierdly running PackerUpdate solved the problem, but it still probably should check availability of buffer before unloading

nxuv avatar Dec 19 '22 09:12 nxuv

Ran into the same problem just now, and :PackerUpdate seemed to solve the problem. I second @al1-ce 's suggestion of checking the buffer for availability.

mbrc12 avatar Dec 19 '22 09:12 mbrc12

Based on that stack, I'm guessing it's related to this:

https://github.com/nvim-tree/nvim-tree.lua/commit/e14c2895b4f36a22001f7773244041c173dcf867

ehaynes99 avatar Dec 19 '22 19:12 ehaynes99

Still, fidget should probably do the same check

nxuv avatar Dec 19 '22 21:12 nxuv

Hi there,

I have same issue and still occurs even after running :PackerUpdate command.

Is there a workaround to avoid this behaviour ? Because it happens a lot...

Thanks !

Yolo390 avatar Dec 23 '22 11:12 Yolo390

@Flo-Slv found any solutions yet? having same issue

ghost avatar Dec 27 '22 16:12 ghost

@Flo-Slv found any solutions yet? having same issue

Nop.. sorry ! Still having this issue

Yolo390 avatar Dec 27 '22 16:12 Yolo390

Check the actual version of nvim-tree.

cd ~/.local/share/nvim/site/pack/packer/start/nvim-tree.lua
git log

See if e14c2895b4f36a22001f7773244041c173dcf867 is in the history (and/or that your version is newer than https://github.com/nvim-tree/nvim-tree.lua/commit/e14c2895b4f36a22001f7773244041c173dcf867). If not, do you have a commit specified in your packer definition for nvim-tree?

EDIT: If that's not it, are you sure it's the same error, where nvim-tree is in the error trace?

ehaynes99 avatar Dec 30 '22 05:12 ehaynes99

Check the actual version of nvim-tree.

cd ~/.local/share/nvim/site/pack/packer/start/nvim-tree.lua
git log

See if e14c2895b4f36a22001f7773244041c173dcf867 is in the history (and/or that your version is newer than nvim-tree/nvim-tree.lua@e14c289). If not, do you have a commit specified in your packer definition for nvim-tree?

EDIT: If that's not it, are you sure it's the same error, where nvim-tree is in the error trace?

Thanks a lot! the problem was the I had tag = 'nightly' in my plugin use command, which I removed and then plugin updated to the new version. I thought nightly is supposed to be up to date as told in the readme

ghost avatar Dec 30 '22 05:12 ghost

I'm not ignoring this error explicitly in #143, but if it comes up after that is merged, please reopen.

j-hui avatar Nov 10 '23 01:11 j-hui