mirror of
https://github.com/preservim/nerdtree.git
synced 2025-02-08 02:12:06 +08:00
correct the window the cursor jumps to on :NERDTree(Close|Toggle)
This commit is contained in:
parent
88aaba22b5
commit
37859888b5
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user