From 8b3ab784ed50d5ea7766059f511eb7b2bb883e64 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Thu, 22 Oct 2020 17:06:48 +0900 Subject: [PATCH] Print error message when fzf --version failed Fix #1145 --- autoload/fzf/vim.vim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index 3a2d653..8ce007e 100644 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -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