From 30b20fc87d4f361c7df794839186bdb2d1f4c960 Mon Sep 17 00:00:00 2001 From: raven42 Date: Thu, 29 Oct 2020 13:21:52 -0500 Subject: [PATCH] Fix issue with tagbar changing the global scrolloff value. (#694) Co-authored-by: Caleb Maclennan --- autoload/tagbar.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index c44f1a4..8626011 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -1906,13 +1906,13 @@ function! s:RenderContent(...) abort if !empty(tagbar#state#get_current_file(0)) && \ fileinfo.fpath ==# tagbar#state#get_current_file(0).fpath let scrolloff_save = &scrolloff - set scrolloff=0 + setlocal scrolloff=0 call cursor(topline, 1) normal! zt call cursor(saveline, savecol) - let &scrolloff = scrolloff_save + let &l:scrolloff = scrolloff_save else " Make sure as much of the Tagbar content as possible is shown in the " window by jumping to the top after drawing