correct the window the cursor jumps to on :NERDTree(Close|Toggle)

This commit is contained in:
marty 2010-09-18 18:11:17 +12:00
parent 88aaba22b5
commit 37859888b5

View File

@ -2820,9 +2820,17 @@ function! s:closeTree()
endif
if winnr("$") != 1
if winnr() == s:getTreeWinNum()
wincmd p
let bufnr = bufnr("")
wincmd p
else
let bufnr = bufnr("")
endif
call s:exec(s:getTreeWinNum() . " wincmd w")
close
call s:exec("wincmd p")
call s:exec(bufwinnr(bufnr) . " wincmd w")
else
close
endif