Closed redyf closed 5 months ago
I also encountered the exact same issue when a confirmation dialogue popped up, though I haven't used noice in some time.
Seems to perhaps be an issue with vim.fn.confirm
no longer blocking the editor as it is now async as it needs to display a floating window render it.
I am not sure how noice does it; the default vim behaviour of vimscript confirm()
is to stop/freeze everything and render a special prompt in the echo area, and then resume the scripting engine from where it was, none the wiser of the time passed.
https://github.com/folke/noice.nvim/issues/388 https://github.com/folke/noice.nvim/issues/337 https://github.com/folke/noice.nvim/issues/232 https://github.com/neovim/neovim/issues/20416 (maybe)
Solution proposed: https://github.com/folke/noice.nvim/issues/232#issuecomment-1408183649
PR in neogit https://github.com/TimUntersberger/neogit/pull/441 with some opinionated and breaking changes. I will resurrect the discussion there and see what we can do.
Thank you for your help in bringing this up.
If its a problem of vim.fn.confirm being called from BufUnload (and causing buffer switching due to the nui popup), then could a potential solution be to simply "save" the contents of the buffer (and whatever is needed) and defer doing the actual work to after BufUnload? Like using vim.schedule
or vim.defer_fn
.
I've got some ideas for this - might be able to get to it soon.
Description
Everytime after confirming a commit on neogit, it spams an error. I noticed that it only happens when noice.nvim plugin is enabled. LazyGit works fine with noice.
Neovim version
NVIM v0.9.0 Build type: Release LuaJIT 2.1.0-beta3
Operating system and version
NixOS 23.11.20230523.d30
Steps to reproduce
Expected behavior
Message was succesfully commited after confirmation with no errors.
Actual behavior
Neogit spam an error after confirming the commit, it keeps showing up until I close neovim entirely!
Minimal config