mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-26 14:56:30 +00:00
Merge pull request #183 from qiemem/generalized-check-if-running
Check if fzf#run() is already executing
This commit is contained in:
commit
40180c18ac
@ -98,6 +98,12 @@ function! s:upgrade(dict)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! fzf#run(...) abort
|
function! fzf#run(...) abort
|
||||||
|
if has('nvim') && bufexists('[FZF]')
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg 'FZF is already running!'
|
||||||
|
echohl NONE
|
||||||
|
return []
|
||||||
|
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', '')
|
||||||
@ -325,12 +331,6 @@ function! s:cmd_callback(lines) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:cmd(bang, ...) abort
|
function! s:cmd(bang, ...) abort
|
||||||
if bufexists('[FZF]')
|
|
||||||
echohl WarningMsg
|
|
||||||
echomsg 'FZF is already running!'
|
|
||||||
echohl NONE
|
|
||||||
return
|
|
||||||
endif
|
|
||||||
let args = copy(a:000)
|
let args = copy(a:000)
|
||||||
if !s:legacy
|
if !s:legacy
|
||||||
let args = insert(args, '--expect=ctrl-t,ctrl-x,ctrl-v', 0)
|
let args = insert(args, '--expect=ctrl-t,ctrl-x,ctrl-v', 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user