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:
parent
4477078170
commit
2027ae03db
@ -207,14 +207,15 @@ endfunction
|
|||||||
" FUNCTION: s:closeTreeWindow() {{{1
|
" FUNCTION: s:closeTreeWindow() {{{1
|
||||||
" close the tree window
|
" close the tree window
|
||||||
function! s:closeTreeWindow()
|
function! s:closeTreeWindow()
|
||||||
if b:NERDTree.isWinTree() && b:NERDTree.previousBuf() != -1
|
if b:NERDTree.isWinTree()
|
||||||
exec "buffer " . b:NERDTree.previousBuf()
|
bp
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
if winnr("$") > 1
|
||||||
|
call g:NERDTree.Close()
|
||||||
else
|
else
|
||||||
if winnr("$") > 1
|
call nerdtree#echo("Cannot close last window")
|
||||||
call g:NERDTree.Close()
|
|
||||||
else
|
|
||||||
call nerdtree#echo("Cannot close last window")
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@ -92,14 +92,11 @@ function! s:Creator.createWindowTree(dir)
|
|||||||
"we want the directory buffer to disappear when we do the :edit below
|
"we want the directory buffer to disappear when we do the :edit below
|
||||||
setlocal bufhidden=wipe
|
setlocal bufhidden=wipe
|
||||||
|
|
||||||
let previousBuf = expand("#")
|
|
||||||
|
|
||||||
"we need a unique name for each window tree buffer to ensure they are
|
"we need a unique name for each window tree buffer to ensure they are
|
||||||
"all independent
|
"all independent
|
||||||
exec g:NERDTreeCreatePrefix . " edit " . self._nextBufferName()
|
exec g:NERDTreeCreatePrefix . " edit " . self._nextBufferName()
|
||||||
|
|
||||||
call self._createNERDTree(path, "window")
|
call self._createNERDTree(path, "window")
|
||||||
let b:NERDTree._previousBuf = bufnr(previousBuf)
|
|
||||||
call self._setCommonBufOptions()
|
call self._setCommonBufOptions()
|
||||||
|
|
||||||
call b:NERDTree.render()
|
call b:NERDTree.render()
|
||||||
|
@ -181,11 +181,6 @@ function! s:NERDTree.PathFilters()
|
|||||||
return s:NERDTree._PathFilters
|
return s:NERDTree._PathFilters
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:NERDTree.previousBuf() {{{1
|
|
||||||
function! s:NERDTree.previousBuf()
|
|
||||||
return self._previousBuf
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
"FUNCTION: s:NERDTree.render() {{{1
|
"FUNCTION: s:NERDTree.render() {{{1
|
||||||
"A convenience function - since this is called often
|
"A convenience function - since this is called often
|
||||||
function! s:NERDTree.render()
|
function! s:NERDTree.render()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user