Print error message when fzf --version failed

Fix #1145
This commit is contained in:
Junegunn Choi
2020-10-22 17:06:48 +09:00
parent 44057cce0e
commit 8b3ab784ed

View File

@@ -72,7 +72,11 @@ function! s:check_requirements()
throw "fzf#exec function not found. You need to upgrade Vim plugin from the main fzf repository ('junegunn/fzf')"
endif
let exec = fzf#exec()
let fzf_version = matchstr(systemlist(exec . ' --version')[0], '[0-9.]*')
let output = systemlist(exec . ' --version')
if v:shell_error || empty(output)
throw 'Failed to run "fzf --version": ' . string(output)
endif
let fzf_version = matchstr(output[0], '[0-9.]\+')
if s:version_requirement(fzf_version, s:min_version)
let s:checked = 1