pwntester / octo.nvim

Edit and review GitHub issues and pull requests from the comfort of your favorite editor
MIT License
2.37k stars 127 forks source link

Lua error when running `:Octo actions` with fzf-lua #415

Closed idanarye closed 1 year ago

idanarye commented 1 year ago

Issue Description

Type: bug report

Describe what happened (or what feature you want)

When using fzf-lua as a picker and running :Octo actions, I get this error:

Error executing Lua callback: ...y/octo.nvim/lua/octo/pickers/fzf-lua/pickers/actions.lua:20: attempt to index global 'opts' (a nil value)                                                                                              
stack traceback:                                                                                                                                                                                                                        
        ...y/octo.nvim/lua/octo/pickers/fzf-lua/pickers/actions.lua:20: in function 'actions'                                                                                                                                           
        ...e/.local/share/nvim/lazy/octo.nvim/lua/octo/commands.lua:1494: in function 'actions'                                                                                                                                         
        ...e/.local/share/nvim/lazy/octo.nvim/lua/octo/commands.lua:22: in function 'o'                                                                                                                                                 
        ...e/.local/share/nvim/lazy/octo.nvim/lua/octo/commands.lua:350: in function 'octo'                                                                                                                                             
        ...e/.local/share/nvim/lazy/octo.nvim/lua/octo/commands.lua:16: in function <...e/.local/share/nvim/lazy/octo.nvim/lua/octo/commands.lua:15>

Describe what you expected to happen

How to reproduce it (as minimally and precisely as possible)

  1. Configure:
    require'octo'.setup {
        picker = 'fzf-lua',
    }
  2. Run the :Octo action command
idanarye commented 1 year ago

The error comes from this line:

https://github.com/pwntester/octo.nvim/blob/22328c578bc013fa4b0cef3d00af35efe0c0f256/lua/octo/pickers/fzf-lua/pickers/actions.lua#L20C1-L20C57

There is no opts. It is a leftover from somewhere? Does it even need a prompt? It does not look like the Telescope version has one.

If removing the prompt is acceptable, I can make a PR myself (otherwise - I'm not sure where to take the prompt from). I think there are other similar places in the fzf-lua integration, and I can hunt them down as well in the same PR.