[Tags] Fall back to --algo=v1 if tags file is too large (> 200MB)
This commit is contained in:
parent
f77b644797
commit
4329721384
1 changed files with 3 additions and 2 deletions
|
@ -773,9 +773,10 @@ function! fzf#vim#tags(query, ...)
|
||||||
let tagfile = tagfiles()[0]
|
let tagfile = tagfiles()[0]
|
||||||
" We don't want to apply --ansi option when tags file is large as it makes
|
" We don't want to apply --ansi option when tags file is large as it makes
|
||||||
" processing much slower.
|
" processing much slower.
|
||||||
if getfsize(tagfile) > 1024 * 1024 * 20
|
let tagsize = getfsize(tagfile)
|
||||||
|
if tagsize > 1024 * 1024 * 20
|
||||||
let proc = 'grep -av ''^\!'' '
|
let proc = 'grep -av ''^\!'' '
|
||||||
let copt = ''
|
let copt = tagsize > 1024 * 1024 * 200 ? '--algo=v1 ' : ''
|
||||||
else
|
else
|
||||||
let proc = 'perl -ne ''unless (/^\!/) { s/^(.*?)\t(.*?)\t/'.s:yellow('\1', 'Function').'\t'.s:blue('\2', 'String').'\t/; print }'' '
|
let proc = 'perl -ne ''unless (/^\!/) { s/^(.*?)\t(.*?)\t/'.s:yellow('\1', 'Function').'\t'.s:blue('\2', 'String').'\t/; print }'' '
|
||||||
let copt = '--ansi '
|
let copt = '--ansi '
|
||||||
|
|
Loading…
Add table
Reference in a new issue