vim-devicons
vim-devicons copied to clipboard
Adding a new file via Nerdtree shows no icon
- Version: NVIM v0.2.2
- DevIcons: 0.9.3
- Terminal (Gnome-Terminal)
- Linux
-
Problem: I open up nerdtree. Press
m
and then pressa
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.
Thanks for the report! :+1: Looks like this no longer works though it did before
Ref: #33, #153
I can confirm this bug with e. g. MacVim 8.1 and ea5bbf0e2a960965accfa50a516773406a5b6b26 (somewhat 0.10.0).
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.
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.
Thanks for the reports, I know it has been a while
Hey guys, any solution on this one? Still having this problem.
Hey guys, any solution on this one? Still having this problem.
Roll back to an older version of NERDTree 🤔
@BaksiLi do you know a commit where the expected behavior is restored? 🙏
Hey guy, Is there any solution to fix this? I still have this problem here
@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.
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 😟
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
.
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 line402-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 :DNote: 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 yourupdatetime
.
This worked for me. I am trying to figure out why this condition is never unvalidated