HiPhish / rainbow-delimiters.nvim

Rainbow delimiters for Neovim with Tree-sitter
https://gitlab.com/HiPhish/rainbow-delimiters.nvim
Apache License 2.0
470 stars 35 forks source link

[Bug]: Failed to run 'config' for rainbow-delimiters.nvim in using the latest commit #47

Closed hungnguyen1503 closed 9 months ago

hungnguyen1503 commented 9 months ago

Neovim version

0.9.2

Language affected

Lua

Query

No response

Strategy

No response

Description

Hi,

I have encountered an error after syncing the latest commit.
The message error: "Failed to run 'config' for rainbow—delimiters.nvim
/AppData/Local/nvim/lua/user/plugins/rainbow.lua:4: attempt to call a table value"
I think that the error is in your change in the lua/rainbow-delimiters/setup.lua
In the previous commits, your plugin has worked for me very well. Could you please check it?
Many thanks
idevat commented 9 months ago

I have the same issue but it seems it is not about the last commit - I fixed it by using the commit c93cc7a6a25469e - this is the last working commit for me. My config is:

require('rainbow-delimiters.setup') {
  query = {
    [''] = 'rainbow-delimiters',
    lua = 'rainbow-blocks',
    html = 'rainbow-parens',
    tsx = 'rainbow-parens',
  },
  highlight = {
    'rainbowcol1',
    'rainbowcol2',
    'rainbowcol3',
    'rainbowcol4',
    'rainbowcol5',
    'rainbowcol6',
    'rainbowcol7',
  },
}
idevat commented 9 months ago

After some inspection, it looks like that the breaking commit is:

8f63f55 2023-10-13 Chad Condon Use idiomatic setup function

The commit 8f63f55fb065e48399dc6e87f195e4d04d5e3166 is actually follower of c93cc7a6a25469e175256f9850d4b36b34073c58 - this does not have to be clear from github commit list.

idevat commented 9 months ago

Ok, the fix of this breaknig change is to use:

require('rainbow-delimiters.setup').setup {

instead of

require('rainbow-delimiters.setup') {

as it is now described in readme.

hungnguyen1503 commented 9 months ago

Hi @idevat ,

Thank you for your suggestion, it has worked very well after using your change. I'll close this ticket.

Many thanks