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]: Error after update #48

Closed kobzar closed 8 months ago

kobzar commented 8 months ago

Neovim version

0.9.4

Language affected

Any

Query

config

Strategy

No response

Description

After last update my working config return the error when nvim is started 
The config:

return {
  {
    "HiPhish/rainbow-delimiters.nvim",
    vim.api.nvim_set_hl(0, "RainbowRed", { fg = "#E06C75" }),
    vim.api.nvim_set_hl(0, "RainbowYellow", { fg = "#E5C07B" }),
    vim.api.nvim_set_hl(0, "RainbowBlue", { fg = "#61AFEF" }),
    vim.api.nvim_set_hl(0, "RainbowOrange", { fg = "#D19A66" }),
    vim.api.nvim_set_hl(0, "RainbowGreen", { fg = "#98C379" }),
    vim.api.nvim_set_hl(0, "RainbowViolet", { fg = "#C678DD" }),
    vim.api.nvim_set_hl(0, "RainbowCyan", { fg = "#36b6db" }),
    event = "VeryLazy",
    -- event = "User AstroFile",
    config = function(_, opts) require "rainbow-delimiters.setup"(opts) end,
    opts = {
      highlight = {
        "RainbowBlue",
        "RainbowGreen",
        "RainbowViolet",
        "RainbowYellow",
        "RainbowCyan",
        "RainbowRed",
        "RainbowOrange",
      },
    },
  },
}

End error to line 13

    config = function(_, opts) require "rainbow-delimiters.setup"(opts) end,

"Attempt to call a table value"

mystilleef commented 8 months ago

The initialization setup has changed.

You can use the following instead.

require ("rainbow-delimiters.setup").setup(opts)
HiPhish commented 8 months ago

Right, the module has changed to work better with some plugin managers. However, thanks to metatable magic there is no reason we cannot have both. Try the latest master, you should be able to call the module directly again now.

kobzar commented 8 months ago

The initialization setup has changed.

You can use the following instead.

require ("rainbow-delimiters.setup").setup(opts)

Thanks this is help