mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
fix a bug with scrolloff
take &scrolloff into account when restoring the window position when recreating the nerd tree window
This commit is contained in:
@@ -2356,9 +2356,12 @@ function! s:RestoreScreenState()
|
|||||||
endif
|
endif
|
||||||
exec("silent ". (g:NERDTreeSplitVertical ? "vertical" : "") ." resize ".t:NERDTreeOldWindowSize)
|
exec("silent ". (g:NERDTreeSplitVertical ? "vertical" : "") ." resize ".t:NERDTreeOldWindowSize)
|
||||||
|
|
||||||
|
let old_scrolloff=&scrolloff
|
||||||
|
let &scrolloff=0
|
||||||
call cursor(t:NERDTreeOldTopLine, 0)
|
call cursor(t:NERDTreeOldTopLine, 0)
|
||||||
normal! zt
|
normal! zt
|
||||||
call setpos(".", t:NERDTreeOldPos)
|
call setpos(".", t:NERDTreeOldPos)
|
||||||
|
let &scrolloff=old_scrolloff
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
"FUNCTION: s:SaveScreenState() {{{2
|
"FUNCTION: s:SaveScreenState() {{{2
|
||||||
|
|||||||
Reference in New Issue
Block a user