Skip to content

Commit

Permalink
Merge pull request #166 from svanharmelen/b-window-switching
Browse files Browse the repository at this point in the history
Do not update when a special buffer is selected
  • Loading branch information
ryanoasis authored Sep 23, 2016
2 parents cb15d79 + 0a65269 commit 0288d01
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions plugin/webdevicons.vim
Original file line number Diff line number Diff line change
Expand Up @@ -369,12 +369,21 @@ function! s:CursorHoldUpdate()
return
endif

" Do not update when a special buffer is selected
if !empty(&l:buftype)
return
endif

" winnr need to make focus go to opened file
" CursorToTreeWin needed to avoid error on opening file
let l:winnr = winnr()
let l:altwinnr = winnr('#')

call g:NERDTree.CursorToTreeWin()
call b:NERDTree.root.refreshFlags()
call NERDTreeRender()

exec l.altwinnr . 'wincmd w'
exec l:winnr . 'wincmd w'
endfunction

Expand Down

0 comments on commit 0288d01

Please sign in to comment.