mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-18 03:50:26 +01:00
Make sure the whole Tagbar content is shown if it is shorter than the window height
This commit is contained in:
@@ -1619,12 +1619,23 @@ function! s:HighlightTag(fname)
|
||||
|
||||
" No tag above cursor position so don't do anything
|
||||
if tagline == 0
|
||||
if line('$') < winheight(0) - 1
|
||||
execute 1
|
||||
call winline()
|
||||
endif
|
||||
execute prevwinnr . 'wincmd w'
|
||||
let &eventignore = eventignore_save
|
||||
redraw
|
||||
return
|
||||
endif
|
||||
|
||||
" If the Tagbar contents are shorter than the window height make sure
|
||||
" that the whole content is shown by jumping to the top of the window
|
||||
if line('$') < winheight(0) - 1
|
||||
execute 1
|
||||
call winline()
|
||||
endif
|
||||
|
||||
" Go to the line containing the tag
|
||||
execute tagline
|
||||
|
||||
|
||||
Reference in New Issue
Block a user