Don't attempt to auto pair on completion, if the completion is a

snippet
This commit is contained in:
Frank Moda 2022-03-03 22:44:38 -05:00
parent 771fda8d16
commit 4fc3c19d1c
2 changed files with 2 additions and 0 deletions

View File

@ -17,6 +17,7 @@ local ignore_append = function(char, kinds, next_char, prev_char, item)
or (not utils.is_in_table(kinds, item.kind))
or (item.textEdit and item.textEdit.newText and item.textEdit.newText:match "[%(%[]")
or (item.insertText and item.insertText:match "[%(%[]")
or (item.insertTextFormat and item.insertTextFormat == cmp.lsp.InsertTextFormat.Snippet)
then
return true
end

View File

@ -32,6 +32,7 @@ _G.MPairs.completion_done = function()
and completion_item.textEdit.newText:match('[%(%[]')
)
or (completion_item.insertText and completion_item.insertText:match('[%(%[]'))
or (completion_item.insertTextFormat and completion_item.insertTextFormat == require('vim.lsp.protocol').InsertTextFormat[2])
then
return
end