fix the q mapping again
since we are now ":edit"ing a new buffer for secondary nerd trees, we have to store the previous buffer number otherwise we get into an infinite loop because we go back to a directory buffer which causes another secondary nerd tree to open etc
This commit is contained in:
parent
d76f936698
commit
2e6cedcad7
@ -2074,10 +2074,17 @@ function! s:initNerdTreeInPlace(dir)
|
|||||||
return
|
return
|
||||||
endtry
|
endtry
|
||||||
|
|
||||||
|
|
||||||
|
let previousBuf = expand("#")
|
||||||
|
|
||||||
"we need a unique name for each secondary tree buffer to ensure they are
|
"we need a unique name for each secondary tree buffer to ensure they are
|
||||||
"all independent
|
"all independent
|
||||||
exec "silent edit " . s:nextBufferName()
|
exec "silent edit " . s:nextBufferName()
|
||||||
|
|
||||||
|
if previousBuf !~ s:NERDTreeBufName . '.*'
|
||||||
|
let b:NERDTreePreviousBuf = previousBuf
|
||||||
|
endif
|
||||||
|
|
||||||
let b:NERDTreeRoot = s:TreeDirNode.New(path)
|
let b:NERDTreeRoot = s:TreeDirNode.New(path)
|
||||||
call b:NERDTreeRoot.open()
|
call b:NERDTreeRoot.open()
|
||||||
|
|
||||||
@ -3178,10 +3185,14 @@ endfunction
|
|||||||
" FUNCTION: s:closeTreeWindow() {{{2
|
" FUNCTION: s:closeTreeWindow() {{{2
|
||||||
" close the tree window
|
" close the tree window
|
||||||
function! s:closeTreeWindow()
|
function! s:closeTreeWindow()
|
||||||
if b:NERDTreeType == "secondary"
|
if b:NERDTreeType == "secondary" && exists("b:NERDTreePreviousBuf")
|
||||||
buffer #
|
exec "buffer " . b:NERDTreePreviousBuf
|
||||||
else
|
else
|
||||||
wincmd c
|
if winnr("$") > 1
|
||||||
|
wincmd c
|
||||||
|
else
|
||||||
|
call s:echo("Cannot close last window")
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
" FUNCTION: s:copyNode() {{{2
|
" FUNCTION: s:copyNode() {{{2
|
||||||
|
Loading…
Reference in New Issue
Block a user