Skip to content

Commit

Permalink
Fixes NERDTree missing folder icon open glyph when pressing (fixes #189)
Browse files Browse the repository at this point in the history
* fixes: NERDTree keymap 'U': move tree root up a dir but leave old root open
  • Loading branch information
ryanoasis committed May 29, 2017
1 parent 4a77915 commit 4f551e9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions nerdtree_plugin/webdevicons.vim
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ function! s:SetupListeners()
call g:NERDTreePathNotifier.AddListener('refreshFlags', 'NERDTreeWebDevIconsRefreshListener')
endfunction

" util like helpers
" scope: local
function! s:Refresh()
call b:NERDTree.root.refreshFlags()
call NERDTreeRender()
endfunction

" Temporary (hopefully) fix for glyph issues in gvim (proper fix is with the
" actual font patcher)

Expand Down Expand Up @@ -222,6 +229,15 @@ function! WebDevIconsNERDTreeMapCloseDir(node)
endif
endfunction

function! WebDevIconsNERDTreeMapUpdirKeepOpen()
call WebDevIconsNERDTreeDirOpen(b:NERDTree.root)
" continue with normal logic:
call nerdtree#ui_glue#upDir(1)
call s:Refresh()
" glyph change possible artifact clean-up
redraw!
endfunction

if g:webdevicons_enable == 1 && g:webdevicons_enable_nerdtree == 1
call s:SetupListeners()

Expand Down Expand Up @@ -270,6 +286,14 @@ if g:webdevicons_enable == 1 && g:webdevicons_enable_nerdtree == 1
\ 'callback': 'WebDevIconsNERDTreeMapActivateNode',
\ 'override': 1,
\ 'scope': 'DirNode' })

" NERDTreeMapUpdirKeepOpen
call NERDTreeAddKeyMap({
\ 'key': g:NERDTreeMapUpdirKeepOpen,
\ 'callback': 'WebDevIconsNERDTreeMapUpdirKeepOpen',
\ 'override': 1,
\ 'scope': 'all' })

endif

" Temporary (hopefully) fix for glyph issues in gvim (proper fix is with the
Expand Down

0 comments on commit 4f551e9

Please sign in to comment.