vim-devicons icon indicating copy to clipboard operation
vim-devicons copied to clipboard

The color of folder icon changed

Open glepnir opened this issue 5 years ago • 23 comments

Hi,today i update the vim-devicons.but i found the color of folder has been changed.this is updated image 22 before update 11

This is my setting

let g:WebDevIconsOS = 'Darwin'
let g:WebDevIconsUnicodeDecorateFolderNodes = 1
let g:DevIconsEnableFoldersOpenClose = 1
let g:DevIconsEnableFolderExtensionPatternMatching = 1

glepnir avatar Nov 13 '18 06:11 glepnir

Seeing the same behavior:

screen shot 2018-11-13 at 11 39 19 am

xguerin avatar Nov 13 '18 16:11 xguerin

Apparently this is caused by https://github.com/scrooloose/nerdtree/commit/6fe967b3b357c50c74ca25a3840a66b705593bce.

As a quick fix I did the following (this is for vim-plug):

Plug 'scrooloose/nerdtree', { 'commit': '8d005db' }

and then ran PlugUpdate.

See https://github.com/scrooloose/nerdtree/issues/918

KostyaEsmukov avatar Nov 24 '18 18:11 KostyaEsmukov

Apparently this is caused by scrooloose/nerdtree@6fe967b.

As a quick fix I did the following (this is for vim-plug):

Plug 'scrooloose/nerdtree', { 'commit': '8d005db' }

and then ran PlugUpdate.

See scrooloose/nerdtree#918

Thanks ,I cut back to the normal version of the past, I will not upgrade for the time being, I will try your way.

glepnir avatar Nov 25 '18 05:11 glepnir

@MagnusHuan could you please reopen this issue?

I believe this is not resolved yet, even though that the root cause is in the nerdtree itself, it directly affects this plugin.

KostyaEsmukov avatar Dec 01 '18 12:12 KostyaEsmukov

I believe this is not resolved yet, even though that the root cause is in the nerdtree itself, it directly affects this plugin.

I agree and I reopened.

kutsan avatar Dec 12 '18 15:12 kutsan

Looking forward to solving

glepnir avatar Dec 13 '18 05:12 glepnir

I personally really like the new folder color and would be sad to see it gone. They should just make it a config option.

cj avatar Dec 13 '18 05:12 cj

highlight! link NERDTreeFlags NERDTreeDir

solves the problem for me. What do you guys think?

kutsan avatar Dec 13 '18 16:12 kutsan

@kutsan this works for me as well.

Do you have any idea where does the new orange color comes from?

KostyaEsmukov avatar Dec 14 '18 21:12 KostyaEsmukov

@KostyaEsmukov

Do you have any idea where does the new orange color comes from?

It comes from here. Basically, additional flags belong to Number highlight group and since directory names have its own Directory highlight group, highlight! link NERDTreeFlags NERDTreeDir links icon colors with directory colors.

kutsan avatar Dec 14 '18 22:12 kutsan

@kutsan

Thanks, that makes sense.

I don't understand exactly the implications of your solution (i.e. how would that affect files having something matching the NERDTreeFlags group in front of them and other vim plugins which prepend stuff to the nerdtree items); but I, personally, don't see any difference in coloring with how it was before that regression.

There are no updates in scrooloose/nerdtree#918 so I guess that this won't be fixed on nerdtree's side anytime soon.

It would be nice to have it fixed in this plugin or, if you believe that messing with highlights on behalf of users is bad, to have it documented at least.

KostyaEsmukov avatar Dec 15 '18 20:12 KostyaEsmukov

@KostyaEsmukov

To be honest, I haven't tested it (and read the source of NERDTree) that much but I don't think that'll cause any problem for you. It'll work as it used to be.

It would be nice to have it fixed in this plugin or, if you believe that messing with highlights on behalf of users is bad, to have it documented at least.

Although, it says I'm a Collaborator, still this is something Ryan needs to decide on. But I think we should wait a little bit more to see what they will say about scrooloose/nerdtree#918.

kutsan avatar Dec 15 '18 21:12 kutsan

This is an interesting one, I am still catching up. I would be open to having some configuration (if possible)..

ryanoasis avatar Feb 14 '19 05:02 ryanoasis

@ryanoasis, let me shed some light on this, now that I'm looking at this again.

The commit in question - https://github.com/scrooloose/nerdtree/commit/6fe967b3b357c50c74ca25a3840a66b705593bce - fixed an oversight in NERDTree. There is a syntax group named NERDTreeFlags that was originally looking for only one character between the brackets, while it was always possible to have multiple flags. Before the commit, when multiple flags were in play, the match wouldn't find anything, and highlighting would revert to the file's or directory's. After the commit, those multi-character flags could be found, and would be colored according to the NERDTreeFlags' highlighting.

I think the easiest, and most correct, solution would be to have vim-devicons clear the NERDTreeFlags syntax group. That way it would be correct for NERDTree-only users, and vim-devicons users would again see the coloring they were used to, where the flags match the filetype. Since people have chimed in on both sides of the issue with respect to the new colors, you could add an option to enable or disable this clearing; I'll leave that up to you.

The DIY solution to this would be to create a file named ~/.vim/after/syntax/nerdtree.vim, and add this line to it:

syntax clear NERDTreeFlags

PhilRunninger avatar Jun 19 '19 15:06 PhilRunninger

Thanks for the follow-up @PhilRunninger

ryanoasis avatar Jun 21 '19 04:06 ryanoasis

@glepnir This is still an issue or are you saying one of the workarounds solved it for you? Thanks

ryanoasis avatar Apr 20 '20 23:04 ryanoasis

@ryanoasis sorry for close.

glepnir avatar Apr 21 '20 05:04 glepnir

Hello, I just updated vim plugins through vim-plug, and I noticed the same behaviour. The icons are all red colored and when I applied the @PhilRunninger solution the folders were blue, the icons had their corresponding color, but there were brackets as well, although I have them disabled. So how do I solve this ?? Thanks in advance.

Goku-San avatar Apr 27 '20 19:04 Goku-San

Hello @ryanoasis @ryanbyon and all the other in this discussion

I just made a workaround for this issue, rather I found one :) And there is no brackets. Works for vim and Gvim on my end.

Check my repo

I hope this issue gets fixed soon.

Goku-San avatar May 05 '20 21:05 Goku-San

Folder and file icons are by default in NERDTreeFlags, which is using same color as Constant, so depending of your color scheme you will see different colors. If you change the color for NERDTreeFlags you will have the same color for folder icons and file icons, which some people might not want. I added syntax for these with my plugin vim-nerdtree-syntax-highlight. It wil now use the same color as the labels for files and folders that do not match another color rule. You can disable this, and also set your custom color.

tiagofumo avatar May 27 '20 10:05 tiagofumo

@tiagofumo Thank you for your kind explanation!

Now, I think it's better to mention about vim-nerdtree-syntax-highlight in the README or the documentation.

What do you think? @her @ryanoasis

get-me-power avatar Jun 10 '20 19:06 get-me-power

I think we should actually document highlight groups.

Directories are highlighted by coloring NERDTreeDir Files are highlighted by coloring NERDTreeFlags

her avatar Jun 10 '20 23:06 her

@her

What you say makes sense. You might also mention a plugin that allows you to change the color of the icon, (like vim-nerdtree-syntax-highlight, for example). The user can choose any color they want use these plugins.

get-me-power avatar Sep 08 '20 07:09 get-me-power