[Tags] Add -a option to grep (#284)

Somehow the tags file generated by ctags for the linux kernel, tag
v4.10-rc1 contains non-ASCII characters. grep stops when it detects
non-ASCII characters. This patch adds the -a option to the grep command
to treat the tags file as ASCII text.

Signed-off-by: Andreas Gerstmayr <andreas.gerstmayr@gmail.com>
This commit is contained in:
Andreas Gerstmayr
2017-01-07 02:56:29 +01:00
committed by Junegunn Choi
parent 2066643243
commit bac82a954f

View File

@@ -766,7 +766,7 @@ function! fzf#vim#tags(query, ...)
" We don't want to apply --ansi option when tags file is large as it makes
" processing much slower.
if getfsize(tagfile) > 1024 * 1024 * 20
let proc = 'grep -v ''^\!'' '
let proc = 'grep -av ''^\!'' '
let copt = ''
else
let proc = 'perl -ne ''unless (/^\!/) { s/^(.*?)\t(.*?)\t/'.s:yellow('\1', 'Function').'\t'.s:blue('\2', 'String').'\t/; print }'' '