commit 5884cf377467fec189cb5c859207f83bfa30774c
parent d15818bafa9e39061abef9f2c4ec80b46e3f5cff
Author: Martin Grenfell <martin_grenfell@msn.com>
Date: Sun, 22 Jun 2008 13:54:32 +1200
fix a bug with scrolloff
take &scrolloff into account when restoring the window position when
recreating the nerd tree window
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim
@@ -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