gelguy / wilder.nvim

A more adventurous wildmenu
MIT License
1.36k stars 34 forks source link

bug: vimL function must not be called in a lua loop callback #135

Open arsham opened 2 years ago

arsham commented 2 years ago

Hi,

I randomly (not too often though, maybe once a day) get the following error:

Error executing luv callback:
...vim/site/pack/packer/opt/wilder.nvim/lua/wilder/shim.lua:10: E5560: vimL function must not be called in a lua loop callback
stack traceback:
        [C]: in function 'call'
        ...vim/site/pack/packer/opt/wilder.nvim/lua/wilder/shim.lua:10: in function '__gc'
        ...installer/jobs/outdated-servers/version-check-result.lua:13: in function 'fail'
        ...er/lua/nvim-lsp-installer/jobs/outdated-servers/init.lua:73: in function 'callback'
        ...lsp-installer/lua/nvim-lsp-installer/core/async/init.lua:87: in function 'cb'
        ...lsp-installer/lua/nvim-lsp-installer/core/async/init.lua:20: in function 'callback'
        ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:146: in function <...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:138>

The happen when the nvim-lsp-installer popup is open.

I have cleared the lua cache (related to the impatient plugin), but I still get this error.

Thank you.

gelguy commented 2 years ago

Thanks for the report! Look like the Lua shim needs to use schedule_wrap when garbage collecting.

I've pushed 0ccdda736de136ac7ef9ce8fc7a77567f251b324 which should fix this issue.