[vim] Update FZF command not set up lengthy prompt on narrow screen

Port of e7928d154a

Since :FZF does not enable preview window, we determine based on full
&columns instead of &columns / 2.
This commit is contained in:
Junegunn Choi 2017-09-07 11:01:40 +09:00
parent 288976310b
commit 5edc3f755c
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

View File

@ -789,6 +789,7 @@ function! s:cmd(bang, ...) abort
else else
let prompt = s:shortpath() let prompt = s:shortpath()
endif endif
let prompt = strwidth(prompt) < &columns - 20 ? prompt : '> '
call extend(opts.options, ['--prompt', prompt]) call extend(opts.options, ['--prompt', prompt])
call extend(opts.options, args) call extend(opts.options, args)
call fzf#run(fzf#wrap('FZF', opts, a:bang)) call fzf#run(fzf#wrap('FZF', opts, a:bang))