brenoprata10 / nvim-highlight-colors

Highlight colors for neovim
724 stars 33 forks source link

nil check when running LSP cache #106

Closed igorlfs closed 5 months ago

igorlfs commented 5 months ago

After the latest commit (5e5fff3), I'm getting spammed with

Error executing vim.schedule lua callback: ...vim-highlight-colors/lua/nvim-highlight-colors/utils.lua:193: attempt to index a nil value
stack traceback:
    ...vim-highlight-colors/lua/nvim-highlight-colors/utils.lua:193: in function 'handler'
    /usr/share/nvim/runtime/lua/vim/lsp/client.lua:687: in function ''
    vim/_editor.lua: in function <vim/_editor.lua:0>

Looking at the source code,

https://github.com/brenoprata10/nvim-highlight-colors/blob/5e5fff3396b9b626383d42c70d3253ce420e3079/lua/nvim-highlight-colors/utils.lua#L193

It looks it's necessary to have a nil check in this line

db757 commented 5 months ago

Came here to say the same thing. You check for nil on line 176 and line 202 but not on 193.

brenoprata10 commented 5 months ago

On it

brenoprata10 commented 5 months ago

Just pushed a fix. Could you try again?

db757 commented 5 months ago

All good now. ty!