summaryrefslogtreecommitdiff
path: root/plugin/fzf.vim
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-08-14 16:22:07 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-08-14 16:23:18 +0900
commit2069bbc8b54fa77384e42274ee15af7b397af884 (patch)
tree551d6a0b1cb690a3ae0ca856b3d13c470b0b830a /plugin/fzf.vim
parent053d628b532546ac0f96147792b7480686fad6b0 (diff)
downloadfzf-2069bbc8b54fa77384e42274ee15af7b397af884.tar.gz
[vim] Allow Funcref in g:fzf_action
https://github.com/junegunn/fzf.vim/issues/185
Diffstat (limited to 'plugin/fzf.vim')
-rw-r--r--plugin/fzf.vim7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugin/fzf.vim b/plugin/fzf.vim
index f8955374..9ce03c03 100644
--- a/plugin/fzf.vim
+++ b/plugin/fzf.vim
@@ -201,7 +201,10 @@ function! s:common_sink(action, lines) abort
return
endif
let key = remove(a:lines, 0)
- let cmd = get(a:action, key, 'e')
+ let Cmd = get(a:action, key, 'e')
+ if type(Cmd) == type(function('call'))
+ return Cmd(a:lines)
+ endif
if len(a:lines) > 1
augroup fzf_swap
autocmd SwapExists * let v:swapchoice='o'
@@ -217,7 +220,7 @@ function! s:common_sink(action, lines) abort
execute 'e' s:escape(item)
let empty = 0
else
- call s:open(cmd, item)
+ call s:open(Cmd, item)
endif
if !has('patch-8.0.0177') && !has('nvim-0.2') && exists('#BufEnter')
\ && isdirectory(item)