Closed 45mg closed 8 months ago
the issue is in
completion = {
autocomplete = true,
},
autocomplete is on by default and it should only be a trigger event array or false
completion.autocomplete
`cmp.TriggerEvent[] | false`
The event to trigger autocompletion. If set to `false`, then completion is
only invoked manually (e.g. by calling `cmp.complete`).
if vim.tbl_contains(config.get().completion.autocomplete or {}, trigger_event) then
this if statement just puts autocomplete as trigger event if it is not (false or nil)
Ah, yes, my mistake. My config worked fine after removing that block. Thank you!
FAQ
Announcement
Minimal reproducible full config
Based on this suggestion, which was based on your suggestion.
Description
Use
<C-e>
to toggle whether enabled or not. When disabled, no issues. When enabled, this error on every keypress in insert-mode -Steps to reproduce
nvim -u cmp-repro.vim
Toggle with
<C-e>
as described above.Expected behavior
Should begin autocompleting when plugin is enabled, and do nothing when plugin is disabled.
Actual behavior
Correctly does nothing when disabled, but gives above-mentioned error when enabled.
Additional context
Based on this suggestion, I'm guessing that
enabled
expects its function to return some kind of function value. Without familiarity with the codebase, I can't say for sure.The plugin help clearly states -
which is probably not true based on the error.