Error detected while processing TextChangedI Autocommands for "*":
vinoff opened this issue · 1 comments
vinoff commented
Error detected while processing TextChangedI Autocommands for "*":
E5108: Error executing lua ...user/.vim/plugged/cmp_luasnip/lua/cmp_luasnip/init.lua:47: attempt to index a boolean value
Press ENTER or type command to continue
Any idea what's causing this? I am trying to make cmp work with luasnip. I have no config for luasnip nor for cmp_luasnip. My config for cmp is the following:
local has_words_before = function()
local cursor = vim.api.nvim_win_get_cursor(0)
return not vim.api.nvim_get_current_line():sub(1, cursor[2]):match('^%s$')
end
local luasnip = require('luasnip')
local cmp = require('cmp')
cmp.setup {
snippet = {
expand = function(args)
require("luasnip").lsp_expand(args.body)
end,
},
mapping = {
['<Tab>'] = cmp.mapping(function(fallback)
if vim.fn.pumvisible() == 1 then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-n>', true, true, true), 'n', true)
elseif has_words_before() and luasnip.expand_or_jumpable() then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-expand-or-jump', true, true, true), '')
else
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function()
if vim.fn.pumvisible() == 1 then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<C-p>', true, true, true), 'n', true)
elseif luasnip.jumpable(-1) then
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes('<Plug>luasnip-jump-prev', true, true, true), '', true)
end
end, { 'i', 's' }),
},
sources = {
{ name = "luasnip" },
{ name = "nvim_lsp" },
{ name = "buffer" },
{ name = "path" },
},
}
vinoff commented
For some reason, I am no longer having this error. It fixed itself. Great.