jalvesaq / Nvim-R

Vim plugin to work with R
GNU General Public License v2.0
968 stars 125 forks source link

Fresh LunarVim install with Nvim-R exits with SIGABRT #792

Closed mschubert closed 10 months ago

mschubert commented 10 months ago

I've installed LunarVim yesterday (release-1.3/neovim-0.9) and added the Nvim-R plugin to ~/.config/lvim/config.lua according to the user plugin docs. This includes setting lazy = false as stated in the README. The only contents of the config file are:

lvim.plugins = {
    {
        "jalvesaq/Nvim-R",
        lazy = false
    }
}

However, if I open a .r file (this can be an existing or new file), wait for the LSP to start, and then exit the editor its exit status is 134 (SIGABRT), so something goes wrong here. Note that this is only visible to me because I'm using the fish shell that reports non-zero exit codes.

If I remove the above lines from the config.lua, exiting works as expected again.

I don't know much about either Nvim-R or LunarVim, so any help to debug this would be greatly appreciated. :LvimOpenlog does not show any errors or warnings.

jalvesaq commented 10 months ago

Nvim-R doesn't include an LSP client...

I also use fish shell and it doesn't report an error when nvim is closed. I didn't try LunarVim, though.

mschubert commented 10 months ago

Nvim-R also worked fine using vanilla nvim for me, so the issue seems to be somewhere between LunarVim and Nvim-R (but I tested this using Plug, not Lazy). The LSP client comes from LunarVim, not Nvim-R.

I unfortunately don't have enough knowledge here to debug this, but maybe someone who reads this will.

jalvesaq commented 10 months ago

Perhaps something at https://github.com/jalvesaq/Nvim-R/issues/753 will be useful to you...

mschubert commented 10 months ago

After a bit more digging I could get the error message when exiting as:

"main: src/unix/core.c:117: uv_close: Assertion `!uv__is_closing(handle)' failed."

This seems to be a Neovim issue, similar to here: https://github.com/neovim/neovim/issues/25086 (I can not reproduce with the examples there) https://github.com/neovim/neovim/issues/21856 (this I can reproduce using the example below)

-- adding this to config.lua, opening a buffer and closing it reproduces
-- the error message above very briefly when exiting
vim.api.nvim_create_autocmd({ "VimLeave" }, {
  callback = function()
    vim.cmd('!notify-send  "hello"')
  end,
})

So I think it's fair to close this here (although I don't know if and how the workaround could be applied to Nvim-R).

jalvesaq commented 10 months ago

The bug should be fixed now. Could you confirm, please?

mschubert commented 10 months ago

This fixes it, thank you!

jalvesaq commented 10 months ago

Thanks for confirming!