Furkanzmc / zettelkasten.nvim

A Vim Philosophy Oriented Zettelkasten Note Taking Plugin
The Unlicense
227 stars 10 forks source link

attempt to call field 'nvim_add_user_command' (a nil value) on open #11

Closed lukamanitta closed 2 years ago

lukamanitta commented 2 years ago

Whenever my Neovim is launched with this plugin installed, I receive this error on startup:

Error detected while processing /Users/lukamanitta/.local/share/nvim/site/pack/packer/start/zettelkasten.nvim/plugin/zettelkasten.lua:
E5113: Error while calling lua chunk: ...k/packer/start/zettelkasten.nvim/plugin/zettelkasten.lua:4: attempt to call field 'nvim_add_user_command' (a nil value)
stack traceback:
    ...k/packer/start/zettelkasten.nvim/plugin/zettelkasten.lua:4: in main chunk

This occurs both with and without a custom setup() function.

Not sure why this is happening as nvim_add_user_command({name}, {command}, {*opts}) is documented in the Neovim api docs. I get the same error if I run a sample line (e.g. :lua vim.api.nvim_add_user_command('SayHello', 'echo "Hello World!"', {}).

So the issue may lie elsewhere but first arose when I tried this plugin.

Does anyone else have this issue?

Furkanzmc commented 2 years ago

nvim_add_user_command is a recent addition to Neovim. I got so used to running HEAD, I forgot to mention this in the README, I apoligise. Can you post your Neovim version? It was added to Neovim with this PR: https://github.com/neovim/neovim/pull/16752

lukamanitta commented 2 years ago

I'm using Neovim 0.6.1, I was using the unstable branch for a while but was getting issues so I went back to stable.

Furkanzmc commented 2 years ago

I'll fix this issue tonight so that I don't force people into using the unstable channel. Thanks for reporting the issue!

Furkanzmc commented 2 years ago

This should now be fixed with the latest master. Thanks for reporting the issue. I'm closing this one, feel free to reopen it if you encounter related problems.