tagbar: do not error out, if autoloaded function does not exist

tagbar is not loaded if filetype plugin is off, so do not try to call a
non-existent function than.
This commit is contained in:
Christian Brabandt 2017-08-23 15:54:06 +02:00
parent e8b6312dd9
commit 232b6415d9
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -29,7 +29,8 @@ let s:airline_tagbar_last_lookup_time = 0
let s:airline_tagbar_last_lookup_val = ''
function! airline#extensions#tagbar#currenttag()
if get(w:, 'airline_active', 0)
if s:airline_tagbar_last_lookup_time != localtime()
" function tagbar#currenttag does not exist, if filetype is not enabled
if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
let s:airline_tagbar_last_lookup_time = localtime()
endif