Skip to content

Bug: Unable to pass option as func #2164

@amlanjlahkar

Description

@amlanjlahkar

RTFM Checklist

  • I have searched exisiting issues / discussions
  • I have read the Wiki including the Advanced section
  • I have read man fzf / I am well versed in shell fzf

Operating system

Mac

Shell

bash

Neovim version (nvim --version)

NVIM v0.11.2

Fzf version (fzf --version)

0.63.0

Output of :lua print(os.getenv('FZF_DEFAULT_OPTS'))

--cycle --history=/Users/amlan/.local/share/fzfhist --prompt='> ' --no-scrollbar --no-separator --no-border --no-height --margin=1 --preview-window='border-sharp' --bind=ctrl-n:down,ctrl-p:up --color=bg+:0,fg:8,preview-fg:8,hl:#d19299,hl+:#e4627e,border:8,gutter:0 --color=info:7,prompt:15,query:15:regular,spinner:7,pointer:9,marker:9,header:4

Is the problem reproducible with mini.sh?

  • My issue is reproducible with mini.sh
  • My issue IS NOT reproducible with mini.sh
  • I have not tested with mini.sh (not relevant, requires LSP, Windows, etc)

Fzf-lua configuration

require('fzf-lua').setup({
    actions = function()
        local actions = require('fzf-lua').actions

        return {
            files = {
                true,
                ['<C-w>q'] = actions.file_sel_to_qf,
            },
        }
    end,
})

Describe the bug / steps to reproduce

The readme cleary states that each of the options under setup call can be passed as a function that returns a table but oddly, when passing actions as a function, I get the following error

Error executing Lua callback: ...an/.local/share/nvim/lazy/fzf-lua/lua/fzf-lua/config.lua:85: attempt to index upvalue 'setup_value' (a function value)
stack traceback:
	...an/.local/share/nvim/lazy/fzf-lua/lua/fzf-lua/config.lua:85: in function '__index'
	.../.local/share/nvim/lazy/fzf-lua/lua/fzf-lua/defaults.lua:358: in function '_actions'
	...an/.local/share/nvim/lazy/fzf-lua/lua/fzf-lua/config.lua:257: in function 'normalize_opts'
	.../share/nvim/lazy/fzf-lua/lua/fzf-lua/providers/files.lua:73: in function <.../share/nvim/lazy/fzf-lua/lua/fzf-lua/providers/files.lua:72>
	...amlan/.local/share/nvim/lazy/fzf-lua/lua/fzf-lua/cmd.lua:35: in function 'run_command'
	.../amlan/.local/share/nvim/lazy/fzf-lua/plugin/fzf-lua.lua:10: in function <.../amlan/.local/share/nvim/lazy/fzf-lua/plugin/fzf-lua.lua:9>

I checked the source but couldn't locate what's actually causing the issue. Help me correct if I'm doing something wrong here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions