Replies: 3 comments 1 reply
-
|
You can check whether |
Beta Was this translation helpful? Give feedback.
-
|
Hey, I'm a bit late to the discussion, and I don't use blink, but when I switched from cmp to the native omnifunction for completion, I also had this problem. I investigated and from what I understand, when the omnifunc completion menu pops up, neovim briefly enters mode 'ic' which triggers the function. What I did was this if
((event.old_mode == 's' and event.new_mode == 'n') or (event.old_mode == 'i' and event.new_mode ~= 'ic'))
and ls.session.current_nodes[vim.api.nvim_get_current_buf()]
and not ls.session.jump_active
then
...
endand it fixed it for me. Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
|
I think my issue is similar, the snippet would fail to populate when using blink completion within a snippet using "repeat_duplicates". This is what's been working for me so far (i.e. checking for vim.api.nvim_create_autocmd('ModeChanged', {
pattern = '*',
callback = function()
if ((vim.v.event.old_mode == 's' and vim.v.event.new_mode == 'n') or (vim.v.event.old_mode == 'i' and vim.v.event.new_mode ~= 'ix'))
and require('luasnip').session.current_nodes[vim.api.nvim_get_current_buf()]
and not require('luasnip').session.jump_active
then
vim.schedule(function()
require('luasnip').unlink_current()
end)
end
end
}) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been using this autocommand to cancel the current LuaSnip session when I'm in Insert mode and and press
<Esc>. (So, pressing<Tab>no longer jumps to the next tabstop.)It works great to my liking, except that it also cancels the session when I do any of the following:
<C-n>.<C-x>(for<C-x><C-f>, which brings up Neovim's native omnicompletion menu).How can I change the above autocommand so that these two exceptions are included?
Beta Was this translation helpful? Give feedback.
All reactions