mirror of
https://github.com/ilyakooo0/nvim-autopairs.git
synced 2024-09-11 15:26:37 +03:00
Don't attempt to auto pair on completion, if the completion is a
snippet
This commit is contained in:
parent
771fda8d16
commit
4fc3c19d1c
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user