uga-rosa / cmp-dictionary

A dictionary completion source for nvim-cmp
MIT License
236 stars 16 forks source link

Error at Nvim startup #57

Closed smsjr closed 5 months ago

smsjr commented 5 months ago

After updating cmp-dictionary, I'm getting the following Nvim startup error:

Error detected while processing /home/smsjr/.config/nvim/init.lua:
E5113: Error while calling lua chunk: ...vim/lazy/cmp-dictionary/lua/cmp_dictionary/dict/trie.lua:25: attempt
to index field 'uv' (a nil value)
stack traceback:
        ...vim/lazy/cmp-dictionary/lua/cmp_dictionary/dict/trie.lua:25: in function 'update'
        ...e/nvim/lazy/cmp-dictionary/lua/cmp_dictionary/source.lua:49: in function '_update'
        ...nvim/lazy/cmp-dictionary/after/plugin/cmp_dictionary.lua:10: in function 'update'
        ...e/nvim/lazy/cmp-dictionary/lua/cmp_dictionary/config.lua:94: in function 'setup'
        /home/smsjr/.config/nvim/lua/plugins/config/dictionary.lua:20: in main chunk
        [C]: in function 'require'
        /home/smsjr/.config/nvim/lua/plugins/init.lua:20: in main chunk
        [C]: in function 'require'
        /home/smsjr/.config/nvim/init.lua:30: in main chunk
Press ENTER or type command to continue

Here's my cmp-dictionary config file:

require('cmp_dictionary').setup({
  paths = { '/usr/share/dict/words' },
  exact_length = 2,
  max_number_items = 50,
  first_case_insensitive = true,
})

The file 'words' exists in the path (/usr/share/dict/words) and the cause of the error is the 'paths' config (without it, the error does not occur, but plugin does not work...).

Any help will be fully appreciated! Thx!!!

uga-rosa commented 5 months ago

Sorry, I'm using nightly so I forgot about the situation with the release version. vim.uv was still vim.loop.

uga-rosa commented 5 months ago

I've got CI working on stable and nightly as well, so I think I'm good to go from here on out. Thanks for the report.