mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -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
|
endif
|
||||||
|
|
||||||
if winnr("$") != 1
|
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")
|
call s:exec(s:getTreeWinNum() . " wincmd w")
|
||||||
close
|
close
|
||||||
call s:exec("wincmd p")
|
call s:exec(bufwinnr(bufnr) . " wincmd w")
|
||||||
else
|
else
|
||||||
close
|
close
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user