See the last line of "fzf --version" output

The output may contain some warning messages from the shell. While such
extra messages should be properly fixed by the user, we can ignore them
by checking the last line of the output.

Related: https://github.com/junegunn/fzf.vim/issues/1145#issuecomment-719465248
This commit is contained in:
Junegunn Choi
2020-10-30 19:34:04 +09:00
parent 7d45724fdd
commit bd3a021ec1

View File

@@ -76,7 +76,7 @@ function! s:check_requirements()
if v:shell_error || empty(output)
throw 'Failed to run "fzf --version": ' . string(output)
endif
let fzf_version = matchstr(output[0], '[0-9.]\+')
let fzf_version = matchstr(output[-1], '[0-9.]\+')
if s:version_requirement(fzf_version, s:min_version)
let s:checked = 1