Fix issue with tagbar changing the global scrolloff value. (#694)

Co-authored-by: Caleb Maclennan <caleb@alerque.com>
This commit is contained in:
raven42 2020-10-29 13:21:52 -05:00 committed by GitHub
parent d55c16e875
commit 30b20fc87d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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