tagbar: do not load, if file size is too large

closes: #2578
This commit is contained in:
Christian Brabandt
2023-01-19 21:46:36 +01:00
parent dc1b607f56
commit 31e01612f3
2 changed files with 8 additions and 0 deletions

View File

@@ -40,6 +40,10 @@ function! airline#extensions#tagbar#currenttag()
unlet! a
let s:init=1
endif
let cursize = getfsize(fnamemodify(bufname('%'), ':p'))
if cursize > 0 && cursize > get(g:, 'airline#extensions#tagbar#max_filesize', 1024 * 1024)
return ''
endif
let flags = get(g:, 'airline#extensions#tagbar#flags', '')
" function tagbar#currenttag does not exist, if filetype is not enabled
if s:airline_tagbar_last_lookup_time != localtime() && exists("*tagbar#currenttag")