mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
correct the window the cursor jumps to on :NERDTree(Close|Toggle)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user