mickael-menu/ShadowVim

"Invalid method: nvim_cmd" at startup

timothycosta opened this issue · 4 comments

Check if applicable

  • I have searched the existing issues (required)
  • I reproduced the issue with an empty Neovim configuration (init.vim or init.lua)
  • I'm willing to help fix the problem and contribute a pull request

Describe the bug

Just installed ShadowVim and tried to run it for the first time. I get the error "Invalid method: nvim_cmd". Ignore, Reset, and Quit all do the same thing. The message appears three to four times and then stops. It appears each time I move my cursor to a new pane in Xcode.

Screenshot 2023-02-24 at 8 39 11 AM

How to reproduce?

  1. Start ShadowVim
  2. Get error

Neovim configuration

Still have the issue with an empty config

Environment

ShadowVim 0.1.0 (1)

$ sw_vers -productVersion
13.0.1

$ uname -m
arm64

$ xcodebuild -version
Xcode 14.2
Build version 14C18

$ nvim --version
NVIM v0.5.1
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: clang -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNVIM_TS_HAS_SET_MATCH_LIMIT -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/tmp/neovim-20210926-83501-wt6eyz/neovim-0.5.1/build/config -I/tmp/neovim-20210926-83501-wt6eyz/neovim-0.5.1/src -I/opt/homebrew/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include -I/opt/homebrew/opt/gettext/include -I/tmp/neovim-20210926-83501-wt6eyz/neovim-0.5.1/build/src/nvim/auto -I/tmp/neovim-20210926-83501-wt6eyz/neovim-0.5.1/build/include
Compiled by brew@HMBRW-A-001-M1-005.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.5.1/share/nvim"

Run :checkhealth for more info

ShadowVim requires Neovim 0.8. I might add something to check the version during runtime to get a more helpful error.

Curious. When I ran nvim --version it claimed I was on 0.8.3. ShadowVim worked after I ran brew upgrade though. Maybe I had more than one version installed or something. Better error could definitely help.

Thanks!

ShadowVim is not run with the PATH from your shell profile (because .app from Finder), so maybe you ran a different nvim binary. I explicitly added to PATH the bin directories of popular package managers:

env["PATH"] = "\(path):\(home)/bin"
// MacPorts: https://guide.macports.org/#installing.shell.postflight
+ ":/usr/local/bin"
// Homebrew: https://docs.brew.sh/FAQ#why-should-i-install-homebrew-in-the-default-location
+ ":/opt/homebrew/bin:/opt/local/bin"
// XDG: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
+ ":\(home)/.local/bin"

I added this quickly: #27

(The VersionTests were generated with copilot.vim thanks to ShadowVim 😉)