taglist: correctly check for right taglist plugin

Avoid the error `Unknown function: taglist#Tlist_Get_Tagname_By_Line`
when using the old tag tlist plugin in a different way.

this means, we have to revert 5841039679
since exists() does not handle autoloaded functions correctly.

We can only check it, after we have used the taglist plugin, so that the
autoloading has happened. That means, move the exists() call after the
`:TListUpdate` call which will correctly autoload taglist and then
exists() can check for the existence of the
`taglist#Tlist_Get_Tagname_By_Line()` function correctly.

closes: #2463
This commit is contained in:
Indelog
2021-11-12 09:37:24 +01:00
committed by Christian Brabandt
parent 5841039679
commit ec761c2adf
2 changed files with 10 additions and 5 deletions

View File

@@ -249,9 +249,7 @@ function! airline#extensions#load()
call airline#extensions#tagbar#init(s:ext)
call add(s:loaded_ext, 'tagbar')
endif
if get(g:, 'airline#extensions#taglist#enabled', 1)
\ && exists(':TlistShowTag')
\ && exists('*taglist#Tlist_Get_Tagname_By_Line')
if get(g:, 'airline#extensions#taglist#enabled', 1) && exists(':TlistShowTag')
call airline#extensions#taglist#init(s:ext)
call add(s:loaded_ext, 'taglist')
endif