Closed mawkler closed 8 months ago
This seems specific to the CursorMoved
event, I tried it with other events and couldn't reproduce. For example:
local M = {}
M.mode = {
k = 'e foo',
j = 'e bar',
}
vim.keymap.set('n', 'M', function()
local id = vim.api.nvim_create_autocmd('BufNew', {
callback = function()
vim.notify('Cursor moved')
end,
})
require('libmodal').mode.enter('Mode', M.mode)
vim.api.nvim_del_autocmd(id)
end)
The special case for CursorMoved
(and I imagine CursorMovedI
as well) seems caused by the Neovim issue mentioned in #27.
Edit: to fix this CursorMoved
can be manually sent out as appropriate.
Ok!
These events should automatically work as expected now
Works great, thank you very much!
To reproduce:
M
to enter custom modek
/j
a couple of times (notice that no notification is sent from the autocmd)<esc>
to leave modek
/j
: now the notification is sent