From d295d20dc4f0374d08ab251732c4052e6de43ce8 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Mon, 27 Mar 2017 06:41:39 +0200 Subject: [PATCH] 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. --- plugin/fzf.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/plugin/fzf.vim b/plugin/fzf.vim index 8e7c04a..820ca56 100644 --- a/plugin/fzf.vim +++ b/plugin/fzf.vim @@ -287,9 +287,12 @@ try set shell=sh endif - if has('nvim') && len(filter(range(1, bufnr('$')), 'bufname(v:val) =~# ";#FZF"')) - call s:warn('FZF is already running!') - return [] + if has('nvim') + 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 [] + endif endif let dict = exists('a:1') ? s:upgrade(a:1) : {} let temps = { 'result': tempname() }