mrjones2014 / nvim-ts-rainbow

Rainbow parentheses for neovim using tree-sitter.
Apache License 2.0
174 stars 4 forks source link

Overwriting colors not getting applied #5

Closed mrjones2014 closed 1 year ago

mrjones2014 commented 1 year ago

Describe the bug

if you try to overwrite the colures use in the rainbow part of the treessitter config the now colors will not get applied

Steps to reproduce

use this as your treesiter configuration

local parsers = require("nvim-treesitter.parsers")

local enabled_list = {"clojure", "fennel","racket"}
require'nvim-treesitter.configs'.setup {
  ensure_installed = "maintained", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
  highlight = {
  enable = true,              -- false will disable the whole extension
    disable = { "c", "rust" },  -- list of language that will be disabled
    -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
    -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
    -- Using this option may slow down your editor, and you may see some duplicate highlights.
    -- Instead of true it can also be a list of languages
    additional_vim_regex_highlighting = false,
  },
  rainbow = {
      enable = true,
      colors = {
          "#E06C75",
          "#E5C07B",
          "#98C379",
          "#56B6C2",
          "#61AFEF",
          "#C678DD",
          "#E06C75"
        },
      extended_mode = true,
      max_file_lines = nil,
      disable = vim.tbl_filter(
      function(p) 
           local disable = true
           for _, lang in pairs(enabled_list) do
               if p==lang then disable = false end
            end
            return disable
      end, parsers.available_parsers()
      )
  }
}

Expected behavior

I expected the the (), [] , and {} to have the colors above not the definition grouvbox colors


Copied from comments:

While it doesn't solve the root issue, I have this workaround in my config:

local rainbow = { "#CC8888", "#CCCC88", "#88CC88", "#88CCCC", "#8888CC", "#CC88CC" }
require "nvim-treesitter.configs".setup {
    rainbow = { colors = rainbow, termcolors = rainbow }
}
for i, c in ipairs(rainbow) do -- p00f/rainbow#81
    vim.cmd(("hi rainbowcol%d guifg=%s"):format(i, c))
end

@gozes is this still reproducible?

mrjones2014 commented 1 year ago

Since I haven't heard anyone complain about this or gotten any feedback on the issue, I am going to close it. Please comment if you can reproduce the issue and I will reopen.