tagbar: move s:flags to inside the function

This matters, if the users later changes the
'airline#extensions#tagbar#flags'  variable, so that it will be taken
into account by the tagbar extension
This commit is contained in:
Christian Brabandt 2023-01-19 21:44:21 +01:00
parent 50a936608c
commit 08cfcf9408
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09

View File

@ -8,7 +8,6 @@ if !exists(':TagbarToggle')
finish finish
endif endif
let s:flags = get(g:, 'airline#extensions#tagbar#flags', '')
let s:spc = g:airline_symbols.space let s:spc = g:airline_symbols.space
let s:init=0 let s:init=0
@ -41,9 +40,10 @@ function! airline#extensions#tagbar#currenttag()
unlet! a unlet! a
let s:init=1 let s:init=1
endif endif
let flags = get(g:, 'airline#extensions#tagbar#flags', '')
" function tagbar#currenttag does not exist, if filetype is not enabled " function tagbar#currenttag does not exist, if filetype is not enabled
if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag") if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags, get(g:, 'airline#extensions#tagbar#searchmethod', 'nearest-stl')) let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', flags, get(g:, 'airline#extensions#tagbar#searchmethod', 'nearest-stl'))
let s:airline_tagbar_last_lookup_time = localtime() let s:airline_tagbar_last_lookup_time = localtime()
endif endif
return s:airline_tagbar_last_lookup_val return s:airline_tagbar_last_lookup_val