mirror of
https://github.com/preservim/tagbar.git
synced 2024-11-23 06:46:12 +08:00
Fix issue with tagbar changing the global scrolloff value. (#694)
Co-authored-by: Caleb Maclennan <caleb@alerque.com>
This commit is contained in:
parent
d55c16e875
commit
30b20fc87d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user