Skip to content

g:fzf_action doesn't accept functions #1348

Description

@x-yuri

a.vim:

function! s:build_quickfix_list(lines)
  call setqflist(map(copy(a:lines), '{ "filename": v:val }'))
  copen
  cc
endfunction

let g:fzf_action = {
  \ 'ctrl-q': function('s:build_quickfix_list')}

Not Alpine Linux-specific.

$ docker run --rm -itv $PWD/a.vim:/a.vim alpine
/ # apk add vim bash curl git ripgrep bat
/ # bash
bash-5.1# TERM=xterm-256color
bash-5.1# cd /usr/share/vim
bash-5.1# vim -Nu <(curl https://gist.githubusercontent.com/junegunn/6936bf79fedd3a079aeb1dd2f3c81ef5/raw)
:so /a.vim
:Rg
ctrl-q
:copen

The build_quickfix_list solution was suggested here and here. It doesn't work because for some reason non-strings are not accepted.

UPD I've found the change. I don't get the description, but in fzf.vim actions only ever received the first filename. And it's kind of confusing:

#621
#867
#185 (comment)
https://github.com/junegunn/fzf/blob/a74731d/README-VIM.md#examples

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions