jalvesaq / Nvim-R

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

neovim 0.10 version startup issue #813

Closed ssh352 closed 6 months ago

ssh352 commented 6 months ago

I upgrade to homebrew neovim 0.10 version and got the following error. RCreateStartMaps

RCreateStartMaps is defined in Nvim-R/R/common_global.vim, for some reason it is not sourced correctly. Please advise.

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: ...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:35: Error executing lua: ...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:36: BufReadPost Autocommands for "*"..FileType Autocommands for "*"..function <S
NR>1_LoadFTPlugin[20]..script /Users/ssh/.vim/plugged/Nvim-R/ftplugin/r_nvimr.vim, line 67: Vim(call):E117: Unknown function: RCreateStartMaps
stack traceback:
        [C]: in function 'nvim_cmd'
        ...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:36: in function <...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:35>
        [C]: in function 'nvim_buf_call'
        ...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:35: in function <...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:10>
stack traceback:
        [C]: in function 'nvim_buf_call'
        ...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:35: in function <...cal/Cellar/neovim/0.10.0/share/nvim/runtime/filetype.lua:10>
:verbose version
NVIM v0.10.0
Build type: Release
LuaJIT 2.1.1713773202

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/local/Cellar/neovim/0.10.0/share/nvim"

Run :checkhealth for more info
jalvesaq commented 6 months ago

I can't replicate the issue with the development version of Neovim. Are any other warning messages displayed by :messages? You could try to completely remove Nvim-R and R.nvim and, then, install Nvim-R again (and never have both installed at the same time).

ssh352 commented 6 months ago

I can't replicate the issue with the development version of Neovim. Are any other warning messages displayed by :messages? You could try to completely remove Nvim-R and R.nvim and, then, install Nvim-R again (and never have both installed at the same time).

I tried it but the issue persist. there are no other warning messages.

Here is what I found

I cd to /usr/local/bin, then ./nvim ~/a.R, the issue is gone

then I cd ~ and nvim a.R, the issue appears again.

I am on MacOS and nvim is installed via homebrew. Luckily R.nvim works without any issue. I use NVIM_APPNAME to separate my Lua (R.nvim) and vim script (nvim-R) configurations. They are separated and won't affect each other.

ssh352 commented 6 months ago

It turns out I have a file r.lua in my home directory, where a.R is. I removed it and the issue is gone.

So it seems that nvim-r is picking up this r.lua file unintentionally.

It could be reproduced by putting a r.lua file together with a a.R file. If you open a.R you will get an error. If you you remove r.lua, there is no error.

jalvesaq commented 6 months ago

I can replicate the issue. Even an empty r.lua causes problems. However, I guess it's a Neovim bug and not something to be fixed in Nvim-R.

ssh352 commented 6 months ago

yeah it may be related to how vim script works. closing since we found the root cause.