fzf#run: improve "is already running" message (#885)

This displays the buffer(s) in this case, which is useful when FZF got
stuck, and you have to manually remove the buffer.
This commit is contained in:
Daniel Hahler 2017-03-27 06:41:39 +02:00 committed by Junegunn Choi
parent 2ba10071c9
commit d295d20dc4

View File

@ -287,10 +287,13 @@ try
set shell=sh set shell=sh
endif endif
if has('nvim') && len(filter(range(1, bufnr('$')), 'bufname(v:val) =~# ";#FZF"')) if has('nvim')
call s:warn('FZF is already running!') let running = filter(range(1, bufnr('$')), "bufname(v:val) =~# ';#FZF'")
if len(running)
call s:warn('FZF is already running (in buffer '.join(running, ', ').')!')
return [] return []
endif endif
endif
let dict = exists('a:1') ? s:upgrade(a:1) : {} let dict = exists('a:1') ? s:upgrade(a:1) : {}
let temps = { 'result': tempname() } let temps = { 'result': tempname() }
let optstr = get(dict, 'options', '') let optstr = get(dict, 'options', '')