mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-17 11:30:28 +01:00
Fix issue with tagbar changing the global scrolloff value. (#694)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user