luochen1990 / rainbow

Rainbow Parentheses Improved, shorter code, no level limit, smooth and fast, powerful configuration.
Apache License 2.0
1.78k stars 95 forks source link

[Bug] extra parentheses '[]' around the directory icon when using rainbow with 'preservim/nerdtree' #182

Closed XingZhiang closed 2 years ago

XingZhiang commented 2 years ago

Describe the bug

there will have extra parentheses '[]' around the directory icon when using rainbow with 'preservim/nerdtree'

Screenshot-20220507-210004.png

luochen1990 commented 2 years ago

What is the filetype (use :set ft? to show it) of the nerdtree buffer?

If you know that, you can disable rainbow for this filetype specificly (See README.md about configuration).

hungpham3112 commented 2 years ago

What is the filetype (use :set ft? to show it) of the nerdtree buffer?

If you know that, you can disable rainbow for this filetype specificly (See README.md about configuration).

""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"                             Plugin: Rainbow                                "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:rainbow_active = 1 
let g:rainbow#pairs = [['(', ')'], ['[', ']'], ['{', '}'], ['<', '>']]
let g:rainbow_conf = { 
    \ 'nerdtree': 0,
    \ }

I disabled this plugin with nerdtree but still see the parentheses.

image

luochen1990 commented 2 years ago

@hungpham3112 What's your output of :set ft? when you focus on the nerdtree buffer?

luochen1990 commented 2 years ago

@hungpham3112 Oh, it's the syntax of your configuration! 'nerdtree': 0 should be inside the seperately block .

luochen1990 commented 2 years ago

See here or here for reference

hungpham3112 commented 2 years ago

@hungpham3112 Oh, it's the syntax of your configuration! 'nerdtree': 0 should be inside the seperately block .

I got it, but it also change the color of commas in code and the color of cursor. How can I configure it? Thanks

image

luochen1990 commented 2 years ago

I cannot figure out what's your current issue, If you are talking about a new issue, please open a new one and describe your observation and expectation so that I can help you, thank you.

hungpham3112 commented 2 years ago

I cannot figure out what's your current issue, If you are talking about a new issue, please open a new one and describe your observation and expectation so that I can help you, thank you.

I mean how can I turn off colorscheme for commas. it just appear when I run: RainbowToggle