mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-05 08:30:03 +08:00
Merge pull request #441 from blueyed/tagbar_once_per_second
tagbar: only lookup tag once every second
This commit is contained in:
commit
6aac1b469d
|
@ -23,9 +23,15 @@ function! airline#extensions#tagbar#inactive_apply(...)
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
let s:airline_tagbar_last_lookup_time = 0
|
||||||
|
let s:airline_tagbar_last_lookup_val = ''
|
||||||
function! airline#extensions#tagbar#currenttag()
|
function! airline#extensions#tagbar#currenttag()
|
||||||
if get(w:, 'airline_active', 0)
|
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
|
endif
|
||||||
return ''
|
return ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user