Closed hongyuanjia closed 4 months ago
I didn't know that. I saw somewhere a recommendation of using vim.system()
instead of vim.fn.system()
and remembered that Vim's function system()
did not work properly on Windows (that's why the use a .bat file in Nvim-R).
I see no problem in using vim.loop.spaw()
. We have only to remember of renaming vim.loop
as vim.uv
before vim.loop
is definitively deprecated. But we already use vim.loop
at other places. So we would have to do this anyway.
Can you do the replacement?
Okay so I got tmp-R-Nvim up and running with Windows and neovim nightly. Will use it during work as my daily driver with R tomorrow and see if any issues pop up.
Great news, @akthe-at !
Looking at Neovim git log, vim.system()
was added on June 2023, but was not included in the next two releases ("focusing on bug fixes"). So, maybe we should take a step back and replace vim.system
with vim.fn.system
(if we need to wait for the output and it works on both Linux and Windows), jobstart
(if we don't need the result), or vim.uv.spaw
as a last resort.
@jalvesaq Please see #41. I added a utils.system()
to mimic vim.system()
, and it works on Windows.
Thanks! I will try it.
Thank you all for your efforts! Currently, I failed to use R.nvim on the current Neovim release. (v0.9.5).
vim.system()
Lua API was added in PR https://github.com/neovim/neovim/pull/23827, which was before when Neovim v0.9.5 was released. However, somehow, it was not included in the current Neovim release. Sincevim.system()
was a wrapper aroundvim.loop.spawn()
, maybe we can use the latter directly? Or at least note that R.nvim only works for the development version of Neovim.Neovim version: