on master help sign in
Check if item.data is a table (#270)

* Check if item.data is a table to prevent an error message if it's a number * fixup! Check if item.data is a table Co-authored-by: __ <__@__>

commit4fc96c8f3df89b6d23e5092d31c866c53a346347 authorTomasz N <przepompownia@users.noreply.github.com> dateSat 1 Oct 2022, 22:50 (4 years ago) parent14cc2a4
1 file changed+1−1
lua/nvim-autopairs/completion/handlers.lua+1−1
lua/nvim-autopairs/completion/handlers.lua+1−1
@@ -12,7 +12,7 @@ M["*"] = function(char, item, bufnr, commit_character)
1212 local char_before, char_after = utils.text_cusor_line(line, col, 1, 1, false)
1313
1414 if char == '' or char_before == char or char_after == char
15− or (item.data and item.data.funcParensDisabled)
15+ or (item.data and type(item.data) == 'table' and item.data.funcParensDisabled)
1616 or (item.textEdit and item.textEdit.newText and item.textEdit.newText:match "[%(%[%$]")
1717 or (item.insertText and item.insertText:match "[%(%[%$]")
1818 or char == commit_character