Closed chardskarth closed 4 years ago
Thanks for the report!
It seems like nvim-libmodal
is installed, which is only for Neovim. The function in the error comes from this file on that other repo.
These two plugins (vim-libmodal
and nvim-libmodal
) are somewhat cross-compatable but can't be installed at the same time. Can you confirm the following for me? It will help in debugging this issue:
libmodal
version (nvim-
/vim-
)Thanks!
Neovim: 0.4.3
nvim-libmodal: dee1f0f
vim-libmodal: e842912 works somehow. Awesome work! I'm very thankful for your library.
Edit: Sorry I dont know how to get the version. I cd
ed to the plugins directory and simply did a glol
I dont have vim-libmodal installed. Here's my neovim autoload folder:
I transferred this issue to this repo since you're using nvim-libmodal
.
Thanks for the clear version statements, that really helps :+1:
As for the issue, I see this:
command! WindowMode call libmodal#Enter('Window', funcref('s:WindowMode'))
The lua-vim interface doesn't like to process funcref
s. You can read more about that here, but in short:
funcref
s wasn't added until a recent 0.5 nightly.funcref()
result, instead, you must pass the name of the function.So the command would look like this:
command! WindowMode call libmodal#Enter('Window', 's:WindowMode')
Thought it won't work without 0.5.
The reason it works with vim-libmodal
is that it is written entirely in Vimscript, so it never has to cross that barrier from Lua to Vim (and thus never has to deal with resolving the funcref()
).
You can test this solution out by downloading Neovim 0.5 and replacing the command
with the one I provided.
Let me know if it works!
Edit: Another way to get around this would be to write your mode in Lua. This approach doesn't require Neovim 0.5
Start by defining a module:
-- yourproject/lua/window_mode.lua
local libmodal = require('libmodal')
local function WindowMode()
-- logic goes here
end
return function()
libmodal.mode.enter('Window', WindowMode)
end
Then define the Vimscript bindings:
command! WindowMode lua require('window_mode')()
Both approaches will work.
I'll have to make do with using vim-libmodal
for now.
Thank you very much. Closing this issue now.
PS I can't thank you enough for this plugin. This really helped me in my workflow!
Happy to help! I posted another solution that doesn't require 0.5, which you can take a look at.
In the meantime, feel free to open any additional tickets as necessary :+1:
Awesome work @Iron-E! But it'd be best if I can make this work.