From ce9fece6266a0739a4a43cbbd1763802a0a0b240 Mon Sep 17 00:00:00 2001 From: Martin Grenfell Date: Thu, 29 May 2008 15:27:42 +1200 Subject: [PATCH] fix screen jumping bug with &scrolloff --- doc/NERD_tree.txt | 3 +++ plugin/NERD_tree.vim | 3 +++ 2 files changed, 6 insertions(+) diff --git a/doc/NERD_tree.txt b/doc/NERD_tree.txt index 8908262..86ed95f 100644 --- a/doc/NERD_tree.txt +++ b/doc/NERD_tree.txt @@ -784,6 +784,9 @@ fridge for later ;) ============================================================================== 7. Changelog *NERDTreeChangelog* +2.9.1 + - fix screen jumping bug with when &scrolloff != 0 + 2.9.0 - path handling improvements, thanks to Zhang Shuhan for heaps of diff --git a/plugin/NERD_tree.vim b/plugin/NERD_tree.vim index 461606a..cfe1a72 100644 --- a/plugin/NERD_tree.vim +++ b/plugin/NERD_tree.vim @@ -2107,9 +2107,12 @@ function! s:RenderView() :silent 1,1delete _ "restore the view + let old_scrolloff=&scrolloff + let &scrolloff=0 call cursor(topLine, 1) normal! zt call cursor(curLine, curCol) + let &scrolloff = old_scrolloff setlocal nomodifiable endfunction