diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 05b8586..d0248b5 100755 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -1223,8 +1223,8 @@ function! s:helptag_sink(line) endfunction function! fzf#vim#helptags(...) - if !executable('grep') || !executable('perl') - return s:warn('Helptags command requires grep and perl') + if !executable('perl') + return s:warn('Helptags command requires perl') endif let sorted = sort(split(globpath(&runtimepath, 'doc/tags', 1), '\n')) let tags = exists('*uniq') ? uniq(sorted) : fzf#vim#_uniq(sorted) @@ -1234,10 +1234,9 @@ function! fzf#vim#helptags(...) endif let s:helptags_script = tempname() - call writefile(['/('.(s:is_win ? '^[A-Z]:[\/\\].*?[^:]' : '.*?').'):(.*?)\t(.*?)\t(.*)/; printf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\t%s\n), $2, $3, $1, $4)'], s:helptags_script) + call writefile(['use Fatal qw(open close); for my $filename (@ARGV) { open(my $file,q(<),$filename); while (<$file>) { /(.*?)\t(.*?)\t(.*)/; push @lines, sprintf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\t%s\n), $1, $2, $filename, $3); } close($file); } print for sort @lines;'], s:helptags_script) return s:fzf('helptags', { - \ 'source': 'grep --with-filename ".*" '.join(map(tags, 'fzf#shellescape(v:val)')). - \ ' | perl -n '.fzf#shellescape(s:helptags_script).' | sort', + \ 'source': 'perl '.fzf#shellescape(s:helptags_script).' '.join(map(tags, 'fzf#shellescape(v:val)')), \ 'sink': s:function('s:helptag_sink'), \ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..3']}, a:000) endfunction