[Tags/Helptags] Do not proceed if perl is not found

Related: https://github.com/junegunn/fzf.vim/issues/22#issuecomment-311873515
This commit is contained in:
Junegunn Choi
2017-07-01 01:18:01 +09:00
parent e1c3bba14b
commit 55f6bc8367

View File

@@ -744,6 +744,9 @@ function! s:tags_sink(lines)
endfunction endfunction
function! fzf#vim#tags(query, ...) function! fzf#vim#tags(query, ...)
if !executable('perl')
return s:warn('Tags command requires perl')
endif
if empty(tagfiles()) if empty(tagfiles())
call inputsave() call inputsave()
echohl WarningMsg echohl WarningMsg
@@ -909,6 +912,9 @@ function! s:helptag_sink(line)
endfunction endfunction
function! fzf#vim#helptags(...) function! fzf#vim#helptags(...)
if !executable('perl')
return s:warn('Helptags command requires perl')
endif
let sorted = sort(split(globpath(&runtimepath, 'doc/tags'), '\n')) let sorted = sort(split(globpath(&runtimepath, 'doc/tags'), '\n'))
let tags = exists('*uniq') ? uniq(sorted) : fzf#vim#_uniq(sorted) let tags = exists('*uniq') ? uniq(sorted) : fzf#vim#_uniq(sorted)