Skip to content
This repository was archived by the owner on Oct 13, 2021. It is now read-only.

Commit ecaccc3

Browse files
committed
fix: use do_complete_done when using vim-vsnip-integ
1 parent 2b90524 commit ecaccc3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lua/completion.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,13 @@ local function applyAddtionalTextEdits(completed_item)
9999
local item = completed_item.user_data.lsp.completion_item
100100
-- vim-vsnip have better additional text edits...
101101
if vim.fn.exists('g:loaded_vsnip_integ') == 1 then
102-
api.nvim_call_function('vsnip_integ#on_complete_done', { completed_item })
102+
api.nvim_call_function('vsnip_integ#do_complete_done', {
103+
{
104+
completed_item = completed_item,
105+
completion_item = item,
106+
apply_additional_text_edits = true
107+
}
108+
})
103109
else
104110
if item.additionalTextEdits then
105111
local bufnr = api.nvim_get_current_buf()
@@ -250,12 +256,6 @@ M.on_attach = function(option)
250256
' "\\<c-e>\\<CR>" : "\\<CR>"',
251257
{silent=false, noremap=false, expr=true})
252258
end
253-
-- overwrite vsnip_integ autocmd since we handle it on ourself in confirmCompletion
254-
if vim.fn.exists("#vsnip_integ") then
255-
api.nvim_command("augroup vsnip_integ")
256-
api.nvim_command("autocmd!")
257-
api.nvim_command("augroup end")
258-
end
259259
vim.b.completion_enable = 1
260260
end
261261

0 commit comments

Comments
 (0)