Comments (6)
I transferred this issue to this repo since you're using nvim-libmodal
.
Thanks for the clear version statements, that really helps 👍
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:
- The ability to resolve
funcref
s wasn't added until a recent 0.5 nightly. - You can't directly pass the
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.
from nvim-libmodal.
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!
from nvim-libmodal.
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:
- Vim version (Neovim/Vim)
libmodal
version (nvim-
/vim-
)
Thanks!
from nvim-libmodal.
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
from nvim-libmodal.
I dont have vim-libmodal installed. Here's my neovim autoload folder:
from nvim-libmodal.
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 👍
from nvim-libmodal.
Related Issues (20)
- consider move initialization to lua HOT 5
- Visual block mode needs to be added to galaxyline config HOT 2
- Indicator functionality within a Layer, OR cursor functionality within a Mode. HOT 2
- Support mapping to function in Layer HOT 1
- Bad styling HOT 1
- Compatibility with `sindrets/winshift.nvim` HOT 2
- feline archieved switch to lualine? HOT 4
- Layers don't seem to be reusable HOT 1
- Error encountered: Expected lua string HOT 6
- Using default bindings from within a mode HOT 8
- Bug: cursor movements aren't updated until after leaving mode HOT 4
- Bug: `vim.v.count` is always 0 HOT 7
- Shallowly switching between libmodal modes HOT 7
- Modifier mappings don't seem to work support HOT 2
- `CursorMoved` / `CursorMovedI` isn't triggered inside custom mode HOT 4
- `TextChanged` isn't triggered in custom mode HOT 3
- What's the best way to expose the mode keymaps table to my consumers? HOT 4
- Attempt to compare number with string in Mode.lua:296 HOT 5
- _Catch All_ Mode mapping HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nvim-libmodal.