p00f/nvim-ts-rainbow

Rainbow doesn't work in header file c

hungnguyen1503 opened this issue · 6 comments

Describe the bug
The rainbow works very well in file .c, but in the header file .h, I don't know why it doesn't work

My config:
local status_ok, configs = pcall(require, "nvim-treesitter.configs")
if not status_ok then
return
end

---@diagnostic disable-next-line: redefined-local
local status_ok, install = pcall(require, "nvim-treesitter.install")
if not status_ok then
return
end

configs.setup({
ensure_installed = { "c", "cpp", "lua", "cmake", "python", "vim", "yaml", "json"}, -- one of "all" or a list of languages

-- ensure_installed = {"maintained"}, -- one of "all" or a list of languages

ignore_install = { "" }, -- List of parsers to ignore installing

sync_install = true,

auto_install = true,

highlight = {
    enable = true, -- false will disable the whole extension
    use_languagetree = true,
    additional_vim_regex_highlighting = false,
},
autopairs = {
    enable = true
},
rainbow = {
    enable = true,
    extended_mode = true,
    max_file_lines = nil,
    colors = {
        '#458588',
        '#b16286',
        '#cc241d',
        '#d65d0e',
        '#458588',
        '#b16286',
        '#cc241d',
        '#d65d0e',
        '#458588',
        '#b16286',
        '#cc241d',
        '#d65d0e',
        '#458588',
        '#b16286',
        '#cc241d',
        '#d65d0e',
     },
     termcolors = {
        'brown',
        'Darkblue',
        'darkgray',
        'darkgreen',
        'darkcyan',
        'darkred',
        'darkmagenta',
        'brown',
        'gray',
        'black',
        'darkmagenta',
        'Darkblue',
        'darkgreen',
        'darkcyan',
        'darkred',
        'red',
     },
},
indent = { enable = true, disable = { "python", "css" } },
matchup = {
    enable = true,
}

})
install.compilers = {"x86_64-w64-mingw32-clang", "gcc", "g++"}

Screenshots
image

p00f commented

You need to fill out the issue template fully

Hi p00f, I have updated my config yet. Please check it.

p00f commented

You also need to paste the code which has buggy highlighting in addition to this screenshot

Currently, I have fixed this issue. Previously, I used onedark theme, but the rainbow doesn't work. When I change to use Tokyo night theme, It works very well
image
Thank you for your support 👯

p00f commented

can this be closed?

Ok, the ticket can be closed.
Many thanks