1
0
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:
Jan Larres
2011-03-04 02:59:40 +13:00
parent 38a6c9f6a1
commit a532d7c445

View File

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