Skip to content
Myr

[vim] Allow Funcref in g:fzf_action

Before adoption: this commit came in with the history the project adopted, so no landing records it.

https://github.com/junegunn/fzf.vim/issues/185

authored by Junegunn Choi · committed by Junegunn Choi · parent 053d628 · Browse files · 3 files+32 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • https: //github.com/junegunn/fzf.vim/issues/185

Diff stats

3 files+32 added−3 removed

  • other:+32 added−3 removed

3 files+32 added−3 removed

modified:doc/fzf.txt+14 added-1 removed
1fzf.txt fzf Last change: April 28 20171fzf.txt fzf Last change: August 14 20172FZF - TABLE OF CONTENTS *fzf* *fzf-toc*3==============================================================================45 FZF Vim integration
73 unmodified lines
79 \ 'ctrl-t': 'tab split',80 \ 'ctrl-x': 'split',81 \ 'ctrl-v': 'vsplit' }8283 " An action can be a reference to a function that processes selected lines84 function! s:build_quickfix_list(lines)85 call setqflist(map(copy(a:lines), '{ "filename": v:val }'))86 copen87 cc88 endfunction8990 let g:fzf_action = {91 \ 'ctrl-q': function('s:build_quickfix_list'),92 \ 'ctrl-t': 'tab split',93 \ 'ctrl-x': 'split',94 \ 'ctrl-v': 'vsplit' }9596 " Default fzf layout97 " - down / up / left / right98 let g:fzf_layout = { 'down': '~40%' }99
96 unmodified lines
modified:plugin/fzf.vim+5 added-2 removed
199 unmodified lines
200 if len(a:lines) < 2201 return202 endif203 let key = remove(a:lines, 0)204 let cmd = get(a:action, key, 'e')204 let Cmd = get(a:action, key, 'e')205 if type(Cmd) == type(function('call'))206 return Cmd(a:lines)207 endif208 if len(a:lines) > 1209 augroup fzf_swap210 autocmd SwapExists * let v:swapchoice='o'211 \| call s:warn('fzf: E325: swap file exists: '.s:fzf_expand('<afile>'))
7 unmodified lines
219 if empty220 execute 'e' s:escape(item)221 let empty = 0222 else220 call s:open(cmd, item)223 call s:open(Cmd, item)224 endif225 if !has('patch-8.0.0177') && !has('nvim-0.2') && exists('#BufEnter')226 \ && isdirectory(item)227 doautocmd BufEnter
558 unmodified lines
modified:README-VIM.md+13 added