Closed wurli closed 6 months ago
With nvim-notify installed, I get this:
2024-03-30T16:11:32 INFO R.nvim is configured
2024-03-30T16:11:32 INFO R.nvim is configured
2024-03-30T16:11:43 INFO R was launched
The only strange thing is that after_config
was run twice.
Could you discover what client
exited with status 1?
Hm - it looks like my Client 1 quit
message was because I was still manually setting up the R language server from before I started using R.nvim
:
local lspconfig = require("lspconfig")
local capabilities = require("cmp_nvim_lsp").default_capabilities()
lspconfig.r_language_server.setup({ capabilities = capabilities })
I've now removed this and it seems to have removed the warning - so thankfully not an issue with R.nvim! Unfortunately, getting rid of this warning hasn't solved my real problem - I'm still unable to get after_R_start()
to run, using nvim-notify
or otherwise 🙁
Sometimes, messages echoed during window splitting aren't visible. So, you could follow a different approach to test the hook:
hook = {
after_config = function() vim.notify("R.nvim is configured") end,
after_R_start = function() vim.g.HookTest = true end,
after_ob_open = nil,
},
Then, after starting R, do :echo HookTest
.
The hook functions now run within vim.schedule()
calls and should be more reliable.
Thank you! I was trying to track down the cause of some lingering weirdness, but my problems seem to have been solved by the change. Many thanks!
I was trying to track down the cause of some lingering weirdness
Lua is less disruptive of editing tasks than VimScript. I guess that because Neovim was busy splitting the window and opening the terminal, it ignored the vim.notify()
command. This might be a bug in Neovim because even if the message was not immediately displayed, it should be stored and then displayed with :messages
.
When I attempt to set this in any way I get an error:
The rest of the package works fine after this, but nothing I put in
after_R_start()
gets run. This happens with even the basic configuration example from the docs: