mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 19:33:50 -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
|
||||
exec("silent ". (g:NERDTreeSplitVertical ? "vertical" : "") ." resize ".t:NERDTreeOldWindowSize)
|
||||
|
||||
let old_scrolloff=&scrolloff
|
||||
let &scrolloff=0
|
||||
call cursor(t:NERDTreeOldTopLine, 0)
|
||||
normal! zt
|
||||
call setpos(".", t:NERDTreeOldPos)
|
||||
let &scrolloff=old_scrolloff
|
||||
endfunction
|
||||
|
||||
"FUNCTION: s:SaveScreenState() {{{2
|
||||
|
||||
Reference in New Issue
Block a user