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
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
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")

View File

@ -1468,6 +1468,10 @@ tagbar <https://github.com/majutsushi/tagbar>
let g:airline#extensions#tagbar#searchmethod = 'nearest-stl' (default)
let g:airline#extensions#tagbar#searchmethod = 'nearest'
let g:airline#extensions#tagbar#searchmethod = 'scoped-stl'
* configure max filesize, after which to skip loading the extension
If the file is larger, tags won't be displayed for performance reasons >
let g:airline#extensions#tagbar#max_filesize = 1024*1024 (default)
<
------------------------------------- *airline-taglist*
taglist <https://github.com/yegappan/taglist>