ryanoasis / vim-devicons

Adds file type icons to Vim plugins such as: NERDTree, vim-airline, CtrlP, unite, Denite, lightline, vim-startify and many more
MIT License
5.65k stars 267 forks source link

devicon missing in NerdTREE when moving up a directory #324

Open krkhan opened 4 years ago

krkhan commented 4 years ago

Required Info

Optional Info

image

Pretty consistent and happens with both vim and nvim. When I navigate up a directory in NerdTREE the devicon is missing for the directory I was just in. Fo.r example, in the screenshot I just navigated up from the teams directory.

aminnairi commented 4 years ago

This also happen when I add a new file/folder. As a quickfix, I have found the reload action (Shift-r) in NERDTree to display the icons back (for the files/folder that had missing icons).

krkhan commented 4 years ago

@aminnairi Good idea. Since I was already using chdir mode 3 (which changes CWD when going up/down a tree), the following helped me automatically refresh:

let g:NERDTreeChDirMode = 3

function NERDRefresh ()
  if &filetype == "nerdtree"
      NERDTreeRefreshRoot
  endif
endfunction

call NERDRefresh()
get-me-power commented 4 years ago

I think it's similar to this problem.

https://github.com/ryanoasis/vim-devicons/issues/224