Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a new file via Nerdtree shows no icon #224

Open
DougBeney opened this issue Jan 11, 2018 · 14 comments
Open

Adding a new file via Nerdtree shows no icon #224

DougBeney opened this issue Jan 11, 2018 · 14 comments

Comments

@DougBeney
Copy link

DougBeney commented Jan 11, 2018

  • 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.

@ryanoasis
Copy link
Owner

Thanks for the report! 👍 Looks like this no longer works though it did before

Ref: #33, #153

@der-flo
Copy link

der-flo commented Feb 10, 2019

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

@jamespharvey20
Copy link

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.

@vinchi777
Copy link

vinchi777 commented Jun 1, 2019

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.

@ryanoasis
Copy link
Owner

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

@ghost
Copy link

ghost commented Mar 22, 2020

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

@BaksiLi
Copy link

BaksiLi commented May 19, 2020

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

Roll back to an older version of NERDTree 🤔

@her
Copy link
Collaborator

her commented May 27, 2020

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

@ngpong
Copy link

ngpong commented Jun 9, 2020

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

@realestninja
Copy link

@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.

@ryanoasis
Copy link
Owner

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 😟

@sarahkittyy
Copy link

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.

@jarodevs
Copy link

jarodevs commented Nov 4, 2020

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

@inzeets
Copy link

inzeets commented Mar 7, 2025

Opened PR fixing this in NERDTree repository: preservim/nerdtree#1438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests