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

Adding a new file via Nerdtree shows no icon

Open DougBeney opened this issue 6 years ago • 13 comments

  • Version: NVIM v0.2.2
  • DevIcons: 0.9.3
  • Terminal (Gnome-Terminal)
  • Linux
  • Problem: I open up nerdtree. Press m and then press a to create a new file. I name the file and it shows up in the tree.

The problem is that the icon does not show. However, this issue corrects itself if I press R in NerdTree to refresh.

DougBeney avatar Jan 11 '18 18:01 DougBeney

Thanks for the report! :+1: Looks like this no longer works though it did before

Ref: #33, #153

ryanoasis avatar Jan 25 '18 02:01 ryanoasis

I can confirm this bug with e. g. MacVim 8.1 and ea5bbf0e2a960965accfa50a516773406a5b6b26 (somewhat 0.10.0).

der-flo avatar Feb 10 '19 14:02 der-flo

This also happens to me every time I go up a directory (.. (up a dir)) to the directory I came from. There's a 4 second delay, as my updatetime is a default of 4 seconds. Both in vim 8.1 and nvim nightly. Significantly lowering updatetime is a workaround.

jamespharvey20 avatar May 28 '19 11:05 jamespharvey20

Still getting this issue NVIM: v0.3.4 Devicons: 0.11.0 NerdTree: 5.0.0 Problem: I open up nerdtree. Press m and then press a to create a new file. I name the file and it shows up in the tree.

vinchi777 avatar Jun 01 '19 04:06 vinchi777

Thanks for the reports, I know it has been a while

ryanoasis avatar Sep 06 '19 05:09 ryanoasis

Hey guys, any solution on this one? Still having this problem.

ghost avatar Mar 22 '20 20:03 ghost

Hey guys, any solution on this one? Still having this problem.

Roll back to an older version of NERDTree 🤔

BaksiLi avatar May 19 '20 04:05 BaksiLi

@BaksiLi do you know a commit where the expected behavior is restored? 🙏

her avatar May 27 '20 06:05 her

Hey guy, Is there any solution to fix this? I still have this problem here

NGPONG avatar Jun 09 '20 09:06 NGPONG

@NGPONG don't think so. It has become a habit for me to hit R to reload nerdtree after adding a file since reloading fixes the missing icon.

realestninja avatar Jun 09 '20 09:06 realestninja

I wonder if there have been changes to how nerdtree does the refresh. We may be relying on deprecated internal methods to refresh the icons 😟

ryanoasis avatar Sep 17 '20 05:09 ryanoasis

Wrote myself a hacky fix since this bugged me on a personal level. If you go into ~/.config/nvim/plugins/vim-devicons/plugin/webdevicons.vim, (or wherever your plugins are located), head over to line 402-404, where you'll see:

if !empty(&l:buftype)
  return
endif

I commented that out, and it initially seems to have solved the problem :D Somehow !empty(&l:buftype) is always true while inside the NERDTree buffer- causing it to fire whenever your cursor is in the NERDTree buffer and you make a new file :D

Note: I use a low updatetime, and it seems to only update the icon on that interval. So if it takes a while for the icon to refresh with this fix, lower your updatetime.

sarahkittyy avatar Oct 20 '20 06:10 sarahkittyy

Wrote myself a hacky fix since this bugged me on a personal level. If you go into ~/.config/nvim/plugins/vim-devicons/plugin/webdevicons.vim, (or wherever your plugins are located), head over to line 402-404, where you'll see:

if !empty(&l:buftype)
  return
endif

I commented that out, and it initially seems to have solved the problem :D Somehow !empty(&l:buftype) is always true while inside the NERDTree buffer- causing it to fire whenever your cursor is in the NERDTree buffer and you make a new file :D

Note: I use a low updatetime, and it seems to only update the icon on that interval. So if it takes a while for the icon to refresh with this fix, lower your updatetime.

This worked for me. I am trying to figure out why this condition is never unvalidated

jarodevs avatar Nov 04 '20 11:11 jarodevs