-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attempt to call local 'fn' (a table value) #1933
Comments
I have the same problem was able to fix by rolling back the latest neovim update. |
You mean I should rollback to nvim 0.9.5? When your car has a flat tire, you replace the tire not the car. |
Several of the items in the Commenting that one out in my comparators list fixed the problem for me. |
Yeah, of course. Just another "workaround". I don't want to downgrade neovim, I don't want to "hide" the problem by commenting it out. I want it to be fixed. That's why I opened this. In fact, I already know the problem is related with comparators:
Instead of suggesting workarounds please upvote the issue so that it can get some attention from developers. |
OK. I have reproduced. |
It seems misc.merge = function(tbl1, tbl2)
local is_dict1 = type(tbl1) == 'table' and (not islist(tbl1) or vim.tbl_isempty(tbl1))
local is_dict2 = type(tbl2) == 'table' and (not islist(tbl2) or vim.tbl_isempty(tbl2))
if is_dict1 and is_dict2 then
local new_tbl = {}
for k, v in pairs(tbl2) do
if tbl1[k] ~= misc.none then
new_tbl[k] = misc.merge(tbl1[k], v)
end
end
for k, v in pairs(tbl1) do
if tbl2[k] == nil then
if v ~= misc.none then
new_tbl[k] = misc.merge(v, {})
else
new_tbl[k] = nil
end
end
end
return new_tbl
end
if tbl1 == misc.none then
return nil
elseif tbl1 == nil then
return misc.merge(tbl2, {})
else
return tbl1
end
end
|
I have fixed it in #1956. Please test. |
@sahinakkaya local comparators = {
cmp.config.compare.exact,
cmp.config.compare.locality,
cmp.config.compare.recently_used,
cmp.config.compare.score,
cmp.config.compare.sources, -- == nil
cmp.config.compare.offset
}
assert(vim.islist(comparators) == false)
|
OK. It seems configuration bug. But I think nil check is needed for it... |
FAQ
Announcement
Minimal reproducible full config
Description
When I open nvim with some comparators defined in nvim-cmp, they are giving me error in the title.
Steps to reproduce
Open nvim with
nvim -u cmp-repro.vim cmp-repro.vim
and just insert any character. You will see an error in the bottom.Expected behavior
I should be able to use all comparators.
Actual behavior
I get an error any time completion list is updated.
Additional context
The text was updated successfully, but these errors were encountered: