Revert "remove NERDTree.previousBuf() and related code"

This reverts commit 2027ae03db.
This commit is contained in:
Martin Grenfell
2016-10-21 14:40:18 +01:00
parent 513bf64555
commit 48df6bfd6e
3 changed files with 15 additions and 8 deletions

View File

@@ -207,15 +207,14 @@ endfunction
" FUNCTION: s:closeTreeWindow() {{{1
" close the tree window
function! s:closeTreeWindow()
if b:NERDTree.isWinTree()
bp
return
endif
if winnr("$") > 1
call g:NERDTree.Close()
if b:NERDTree.isWinTree() && b:NERDTree.previousBuf() != -1
exec "buffer " . b:NERDTree.previousBuf()
else
call nerdtree#echo("Cannot close last window")
if winnr("$") > 1
call g:NERDTree.Close()
else
call nerdtree#echo("Cannot close last window")
endif
endif
endfunction