diff options
| author | Junegunn Choi <junegunn.c@gmail.com> | 2024-08-28 13:41:46 +0900 |
|---|---|---|
| committer | Junegunn Choi <junegunn.c@gmail.com> | 2024-08-28 13:41:46 +0900 |
| commit | d06c5ab990d673ac4da1a150ca04e783c4ff3e82 (patch) | |
| tree | dd238e4476dc4091057058db6a1fc49664d63795 /plugin/fzf.vim | |
| parent | e0924d27b845582e51552f5d34a5ac2f050f0b27 (diff) | |
| download | fzf-d06c5ab990d673ac4da1a150ca04e783c4ff3e82.tar.gz | |
[vim] Require fzf 0.53.0 or above (with --tmux)
Close #3980
Diffstat (limited to 'plugin/fzf.vim')
| -rw-r--r-- | plugin/fzf.vim | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 0f05c453..598b2084 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -198,6 +198,7 @@ function! s:compare_binary_versions(a, b) return s:compare_versions(s:get_version(a:a), s:get_version(a:b)) endfunction +let s:min_version = '0.53.0' let s:checked = {} function! fzf#exec(...) if !exists('s:exec') @@ -225,7 +226,8 @@ function! fzf#exec(...) let s:exec = binaries[-1] endif - if a:0 && !has_key(s:checked, a:1) + let min_version = a:0 ? a:1 : s:min_version + if !has_key(s:checked, min_version) let fzf_version = s:get_version(s:exec) if empty(fzf_version) let message = printf('Failed to run "%s --version"', s:exec) @@ -233,17 +235,17 @@ function! fzf#exec(...) throw message end - if s:compare_versions(fzf_version, a:1) >= 0 - let s:checked[a:1] = 1 + if s:compare_versions(fzf_version, min_version) >= 0 + let s:checked[min_version] = 1 return s:exec - elseif a:0 < 2 && input(printf('You need fzf %s or above. Found: %s. Download binary? (y/n) ', a:1, fzf_version)) =~? '^y' + elseif a:0 < 2 && input(printf('You need fzf %s or above. Found: %s. Download binary? (y/n) ', min_version, fzf_version)) =~? '^y' let s:versions = {} unlet s:exec redraw call fzf#install() - return fzf#exec(a:1, 1) + return fzf#exec(min_version, 1) else - throw printf('You need to upgrade fzf (required: %s or above)', a:1) + throw printf('You need to upgrade fzf (required: %s or above)', min_version) endif endif |
