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

Commit 2b675e3

Browse files
committed
fix: slightly fix with integration with vsnip
1 parent b774408 commit 2b675e3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lua/completion/util.lua

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ end
1616
-- completion items --
1717
------------------------
1818
local function get_completion_word(item)
19-
if item.insertText ~= nil and item.insertText ~= vim.NIL then
20-
return item.insertText
21-
elseif item.textEdit ~= nil and item.textEdit ~= vim.NIL
22-
and item.textEdit.newText ~= nil and item.insertTextFormat ~= 2 then
19+
if item.textEdit ~= nil and item.textEdit ~= vim.NIL
20+
and item.textEdit.newText ~= nil and (item.insertTextFormat ~= 2 or vim.fn.exists('g:loaded_vsnip_integ')) then
2321
return item.textEdit.newText
22+
elseif item.insertText ~= nil and item.insertText ~= vim.NIL then
23+
return item.insertText
2424
end
2525
return item.label
2626
end

0 commit comments

Comments
 (0)