Merge pull request #441 from blueyed/tagbar_once_per_second

tagbar: only lookup tag once every second
This commit is contained in:
Bailey Ling 2014-02-19 22:21:42 -05:00
commit 6aac1b469d

View File

@ -23,9 +23,15 @@ function! airline#extensions#tagbar#inactive_apply(...)
endif
endfunction
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)
return tagbar#currenttag('%s', '', s:flags)
if s:airline_tagbar_last_lookup_time != localtime()
let s:airline_tagbar_last_lookup_val = tagbar#currenttag('%s', '', s:flags)
let s:airline_tagbar_last_lookup_time = localtime()
endif
return s:airline_tagbar_last_lookup_val
endif
return ''
endfunction