Hello, I'm having trouble setting a custom operator mode key mapping with the new Lua API.
Previously I had the following:
vim.keymap.set('n', '<leader>co', function()
require('Comment.api').call('toggle_linewise_op')
vim.api.nvim_feedkeys('g@', 'n', false)
end, { desc = '[C]omment [O]perator' })
This worked great.
Saw that this and my previous mappings were giving me a deprecated warning so I decided to change my current mappings to match the new API. All my other bindings work except this one.
I updated it to look like this:
vim.keymap.set('n', '<leader>co', function()
require('Comment.api').call('toggle.linewise')
vim.api.nvim_feedkeys('g@', 'n', false)
end, { desc = '[C]omment [O]perator' })
And I just get 'operatorfunc' is empty.
I also tried the suggested mapping in the docs:
vim.keymap.set('n', '<leader>gc', '<CMD>lua require("Comment.api").call("toggle.linewise")<CR>g@')
and I still get the same thing: 'operatorfunc' is empty.
Hello, I'm having trouble setting a custom operator mode key mapping with the new Lua API.
Previously I had the following:
This worked great.
Saw that this and my previous mappings were giving me a deprecated warning so I decided to change my current mappings to match the new API. All my other bindings work except this one.
I updated it to look like this:
And I just get 'operatorfunc' is empty.
I also tried the suggested mapping in the docs:
and I still get the same thing: 'operatorfunc' is empty.