Skip to content
Myr

[vim] Require fzf 0.53.0 or above (with --tmux)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Close #3980

authored by Junegunn Choi · committed by Junegunn Choi · parent e0924d2 · Browse files · 1 file+8 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+8 added−6 removed

  • other:+8 added−6 removed

1 file+8 added−6 removed

modified:plugin/fzf.vim+8 added-6 removed
196 unmodified lines
197function! s:compare_binary_versions(a, b)198 return s:compare_versions(s:get_version(a:a), s:get_version(a:b))199endfunction200201let s:min_version = '0.53.0'202let s:checked = {}203function! fzf#exec(...)204 if !exists('s:exec')205 let binaries = []
19 unmodified lines
225226 let s:exec = binaries[-1]227 endif228228 if a:0 && !has_key(s:checked, a:1)229 let min_version = a:0 ? a:1 : s:min_version230 if !has_key(s:checked, min_version)231 let fzf_version = s:get_version(s:exec)232 if empty(fzf_version)233 let message = printf('Failed to run "%s --version"', s:exec)234 unlet s:exec235 throw message236 end237236 if s:compare_versions(fzf_version, a:1) >= 0237 let s:checked[a:1] = 1238 if s:compare_versions(fzf_version, min_version) >= 0239 let s:checked[min_version] = 1240 return s:exec239 elseif a:0 < 2 && input(printf('You need fzf %s or above. Found: %s. Download binary? (y/n) ', a:1, fzf_version)) =~? '^y'241 elseif a:0 < 2 && input(printf('You need fzf %s or above. Found: %s. Download binary? (y/n) ', min_version, fzf_version)) =~? '^y'242 let s:versions = {}243 unlet s:exec244 redraw245 call fzf#install()244 return fzf#exec(a:1, 1)246 return fzf#exec(min_version, 1)247 else246 throw printf('You need to upgrade fzf (required: %s or above)', a:1)248 throw printf('You need to upgrade fzf (required: %s or above)', min_version)249 endif250 endif251252 return s:exec
848 unmodified lines