mirror of
https://github.com/gryf/tagbar.git
synced 2025-12-18 03:50:26 +01:00
Update to use file size instead of line count
This commit is contained in:
@@ -1158,14 +1158,16 @@ function! s:ProcessFile(fname, ftype) abort
|
||||
return
|
||||
endif
|
||||
|
||||
" If the file size limit it set, then check the linecount to see if
|
||||
" If the file size limit it set, then check the file size to see if
|
||||
" this file should be ignored or not.
|
||||
if g:tagbar_file_size_limit > 0
|
||||
let linecount = line('$')
|
||||
let linecount = getfsize(expand('%'))
|
||||
if linecount > g:tagbar_file_size_limit && !exists('b:tagbar_force_update')
|
||||
call tagbar#debug#log('[ProcessFile] File size too large (' . linecount . ' lines) - limit set to ' . g:tagbar_file_size_limit)
|
||||
call tagbar#debug#log('[ProcessFile] File size too large (' . linecount .
|
||||
\ ' bytes) - limit set to ' . g:tagbar_file_size_limit)
|
||||
if !exists('b:tagbar_file_exceeds_limit')
|
||||
echom 'File size too large (' . linecount . ' lines) - Not processing file (see help for g:tagbar_file_size_limit).'
|
||||
echom 'File size too large (' . linecount .
|
||||
\ ' bytes) - Not processing file (see help for g:tagbar_file_size_limit).'
|
||||
let b:tagbar_file_exceeds_limit = 1
|
||||
endif
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user