-
I am working on cmp-nvim-ultisnips and we had a few requests about calling functions silently. Currently we have this mapping in the readme: local t = function(key)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), "n", true)
end
mapping = {
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.get_selected_entry() == nil and vim.fn["UltiSnips#CanExpandSnippet"]() == 1 then
t("<C-r>=[UltiSnips#CursorMoved(), UltiSnips#ExpandSnippet()][1]<cr>")
elseif vim.fn["UltiSnips#CanJumpForwards"]() == 1 then
t("<C-r>=[UltiSnips#CursorMoved(), UltiSnips#JumpForwards()][1]<cr>")
elseif cmp.visible() then
cmp.select_next_item()
else
fallback()
end
)
} However, each time a snippet is expanded the text I know this is not directly related to cmp but I thought maybe someone here has an idea how to |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
The feedkeys isn't support
|
Beta Was this translation helpful? Give feedback.
The feedkeys isn't support
silent
. So this problem is a bit complex to solve.