mirror of
https://github.com/preservim/nerdtree.git
synced 2025-02-12 20:24:00 +08:00
save and restore the size of the window
store the old nerd tree window size as a tabpage local variable and restore it when reloading the tree window
This commit is contained in:
parent
f74ec0661d
commit
d15818bafa
|
@ -2351,9 +2351,10 @@ endfunction
|
|||
"
|
||||
"Assumes the cursor is in the NERDTree window
|
||||
function! s:RestoreScreenState()
|
||||
if !exists("t:NERDTreeOldTopLine") || !exists("t:NERDTreeOldPos")
|
||||
if !exists("t:NERDTreeOldTopLine") || !exists("t:NERDTreeOldPos") || !exists("t:NERDTreeOldWindowSize")
|
||||
return
|
||||
endif
|
||||
exec("silent ". (g:NERDTreeSplitVertical ? "vertical" : "") ." resize ".t:NERDTreeOldWindowSize)
|
||||
|
||||
call cursor(t:NERDTreeOldTopLine, 0)
|
||||
normal! zt
|
||||
|
@ -2368,6 +2369,7 @@ endfunction
|
|||
function! s:SaveScreenState()
|
||||
let t:NERDTreeOldPos = getpos(".")
|
||||
let t:NERDTreeOldTopLine = line("w0")
|
||||
let t:NERDTreeOldWindowSize = g:NERDTreeSplitVertical ? winwidth("") : winheight("")
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:SetupSyntaxHighlighting() {{{2
|
||||
|
|
Loading…
Reference in New Issue
Block a user