remove NERDTree.previousBuf() and related code

We were using this when closing a wintree - to go to the previous
buffer. Not sure why we weren't just using `:bprev` ...
This commit is contained in:
Martin Grenfell
2016-10-19 13:28:44 +01:00
parent 4477078170
commit 2027ae03db
3 changed files with 8 additions and 15 deletions

View File

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