From 5884cf377467fec189cb5c859207f83bfa30774c Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Sun, 22 Jun 2008 13:54:32 +1200 Subject: [PATCH] fix a bug with scrolloff take &scrolloff into account when restoring the window position when recreating the nerd tree window --- plugin/NERD_tree.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 84aabba..04df7cf 100644 --- 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